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

17
LINES

< > BotCompany Repo | #1013404 // nextScheduledGC - returns in now() time

JavaX fragment (include)

1  
static long nextScheduledGC() {
2  
  for (java.util.Timer timer : _registeredTimersOf(getJavaX())) {
3  
    L entries = cast get(timer, 'entries);
4  
    for (O entry : entries) {
5  
      O task = get(entry, 'task);
6  
      O runnable = getOpt(task, 'r);
7  
      if (isString(runnable) && startsWith(runnable/S, "regularGC")) {
8  
        long firstTime = getLong(entry, 'firstTime);
9  
        long period = getLong(entry, 'period);
10  
        long now = now();
11  
        long elapsed = mod(now-firstTime, period);
12  
        ret now-elapsed+period;
13  
      }
14  
    }
15  
  }
16  
  ret 0;
17  
}

Author comment

Began life as a copy of #1013403

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1013404
Snippet name: nextScheduledGC - returns in now() time
Eternal ID of this version: #1013404/5
Text MD5: ed80c84e1cb7165022c21a5e71e169c5
Author: stefan
Category: javax / monitoring
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-01-05 02:09:32
Source code size: 566 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 439 / 484
Version history: 4 change(s)
Referenced in: [show references]