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

21
LINES

< > BotCompany Repo | #1005776 // Benchmark Making Screenshots (Full + Part)

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (2105L/14K/46K).

!752

p {
  bench(r { shootScreen2(0, 0, 200, 100) }, 100);
  bench(r { new BWImage(shootScreen2(0, 0, 200, 100)) }, 100);
  //bench(r { shootScreen2() }, 1);
  bench(r { new BWImage(shootScreen2()) }, 1);
}

static int bench_seconds = 5;

svoid bench(Runnable runnable, int repetitions) {
  long start = now();
  while (now()-start < bench_seconds*1000) { // do it for at least x seconds
    long time = now();
    for i to repetitions:
      runnable.run();
    double duration = (now()-time)/(double) repetitions;
    print(runnable + ": " + formatDouble(duration, 1) + " ms");
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, sawdedvomwva, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1005776
Snippet name: Benchmark Making Screenshots (Full + Part)
Eternal ID of this version: #1005776/1
Text MD5: 3f9b6e21736694552c433a6592d5130f
Transpilation MD5: b89922dee397758169cb701f61dcd07a
Author: stefan
Category: javax / ocr
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-12-08 15:24:43
Source code size: 606 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 578 / 660
Referenced in: [show references]