static long timer_nextFireTime(O timer, long now) { long best = 0; for (O entry : unnull((Collection) getOpt(timer, 'entries))) { Long firstTime = cast getOpt(entry, 'firstTime); Long period = cast getOpt(entry, 'period); if (firstTime != null && period != null) if (now >= firstTime) { long fireTime = now + period-((now - firstTime) % period); if (best == 0 || fireTime < best) best = fireTime; } } ret best; }
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1017642 |
Snippet name: | timer_nextFireTime |
Eternal ID of this version: | #1017642/2 |
Text MD5: | 8a7a4735db862a4e9b1a36167dba98ae |
Author: | stefan |
Category: | javax / timers |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-07-31 13:55:02 |
Source code size: | 472 bytes / 13 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 323 / 352 |
Version history: | 1 change(s) |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) |