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

11
LINES

< > BotCompany Repo | #1025490 // maxExecutionGap - are we constantly getting CPU time?

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

Libraryless. Click here for Pure Java version (89L/1K).

// result is in nanoseconds
// runs for one second
static long maxExecutionGap() {
  long time = nanoTime(), end = nanoTime()+oneBillion(), max = 0;
  while (time < end) {
    long time2 = nanoTime();
    max = max(max, time2-time);
    time = time2;
  }
  ret max;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1025490
Snippet name: maxExecutionGap - are we constantly getting CPU time?
Eternal ID of this version: #1025490/2
Text MD5: 5f129c4947baecf9baa3fe94501c240b
Transpilation MD5: 0c19cb82b4cf0133fb1e32848ae56bda
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-08-01 14:15:19
Source code size: 277 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 242 / 343
Version history: 1 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1029338 - maxExecutionGap10 - call maxExecutionGap 10 times