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

7
LINES

< > BotCompany Repo | #1032220 // repeatForNSeconds_atLeastOnce

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

Libraryless. Click here for Pure Java version (3082L/17K).

svoid repeatForNSeconds_atLeastOnce(double seconds default defaultWarmUpSeconds(), Runnable f) {
  if (f == null) ret;
  long endTime = sysNow()+toMS(seconds);
  do {
    f.run();
  } while (sysNow() < endTime);
}

Author comment

Began life as a copy of #1032046

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx

No comments. add comment

Snippet ID: #1032220
Snippet name: repeatForNSeconds_atLeastOnce
Eternal ID of this version: #1032220/1
Text MD5: 92309b182a5f891b191c02e41f52d9d5
Transpilation MD5: 0603253bb87d95b4640bd8dba9aead21
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-08-20 11:55:22
Source code size: 219 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 67 / 97
Referenced in: [show references]