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

15
LINES

< > BotCompany Repo | #1006290 // RegTimer

JavaX fragment (include)

sclass RegTimer {
  long interval = 1000, lastHit;
  
  *() {}
  *(long *interval) {}
  
  bool hit() {
    long now = sysNow();
    if (lastHit+interval <= now) {
      lastHit = now;
      true;
    }
    false;
  }
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1006290
Snippet name: RegTimer
Eternal ID of this version: #1006290/1
Text MD5: 32802f7b7e980cad147913fbc08cc192
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-12-26 16:48:41
Source code size: 233 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 528 / 1078
Referenced in: [show references]