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

15
LINES

< > BotCompany Repo | #1006290 // RegTimer

JavaX fragment (include)

1  
sclass RegTimer {
2  
  long interval = 1000, lastHit;
3  
  
4  
  *() {}
5  
  *(long *interval) {}
6  
  
7  
  bool hit() {
8  
    long now = sysNow();
9  
    if (lastHit+interval <= now) {
10  
      lastHit = now;
11  
      true;
12  
    }
13  
    false;
14  
  }
15  
}

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: 535 / 1085
Referenced in: [show references]