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


< > BotCompany Repo | #1027048 - waitUntil - wait for condition, check in regular intervals

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

Libraryless. Click here for Pure Java version (2544L/16K).

svoid waitUntil(int interval, IF0<Bool> condition) {
  if (condition == null) ret;
  while (!condition.get()) sleep(interval);

sbool waitUntil(int interval, double timeout, IF0<Bool> condition) {
  if (condition == null) false;
  long start = sysNow();
  while (sysNow() < start+toMS(timeout))
    if (condition.get())

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: #1027048
Snippet name: waitUntil - wait for condition, check in regular intervals
Eternal ID of this version: #1027048/4
Text MD5: bb623d1b44ee1d0900c7b9446191568f
Transpilation MD5: 3302b88084fe78cc4884de9cdba6ab0d
Author: stefan
Category: javax / stefan's os
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-07-01 17:05:05
Source code size: 390 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 83 / 149
Version history: 3 change(s)
Referenced in: [show references]

Formerly at &