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

19
LINES

< > BotCompany Repo | #1004683 - doEvery - install a java.util.Timer

JavaX fragment (include)

// firstDelay = delay
static FixedRateTimer doEvery(long delay, final O r) {
  ret doEvery(delay, delay, r);
}

static FixedRateTimer doEvery(long delay, long firstDelay, final O r) {
  FixedRateTimer timer = new(shorten(programID() + ": " + r, 80));
  timer.scheduleAtFixedRate(smartTimerTask(r, timer, toInt(delay)), toInt(firstDelay), toInt(delay));
  ret timer;
}

// reversed argument order for fun
static FixedRateTimer doEvery(double initialSeconds, double delaySeconds, final O r) {
  ret doEvery(toMS(delaySeconds), toMS(initialSeconds), r);
}

static FixedRateTimer doEvery(double delaySeconds, final O r) {
  ret doEvery(toMS(delaySeconds), r);
}

download  show line numbers  debug dex   

Travelled to 11 computer(s): aoiabmzegqzx, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, tslmcundralx, tvejysmllsmz

No comments. add comment

Snippet ID: #1004683
Snippet name: doEvery - install a java.util.Timer
Eternal ID of this version: #1004683/9
Text MD5: c62ee30c9aafae48f8eefd3998c9fcf2
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-07-19 13:59:21
Source code size: 677 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 436 / 430
Version history: 8 change(s)
Referenced in: [show references]