Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

22
LINES

< > BotCompany Repo | #1034589 // MultiBencherDemo

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (13053L/77K).

1  
sclass MultiBencherDemo {
2  
  MultiBencher bencher;
3  
  
4  
  new DoubleVar var;
5  
  Runnable action = r {
6  
    double x = 0;
7  
    repeat 1000 { x += random(); }
8  
    var.set(x);
9  
  };
10  
  
11  
  swappable MultiBencher makeBencher() {
12  
    ret new MultiBencher().interval(0.001).seconds(5.0);
13  
  }
14  
  
15  
  run {
16  
    bencher = makeBencher();
17  
    bencher.action(action);
18  
    bencher.run();
19  
    print(+var);
20  
    showText("Bench", bencher.renderMinRecords() + "\n" + str(bencher));
21  
  }
22  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1034589
Snippet name: MultiBencherDemo
Eternal ID of this version: #1034589/2
Text MD5: 3ae93bc8f64811595440e1cdd34da8d0
Transpilation MD5: 88753b4edc38a1b8069bb5ad335666d6
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-02-19 07:00:36
Source code size: 480 bytes / 22 lines
Pitched / IR pitched: No / No
Views / Downloads: 183 / 304
Version history: 1 change(s)
Referenced in: [show references]