Vibe.d timer - change callback?

codic codic at linuxmail.org
Tue Aug 25 18:42:53 UTC 2020


I'd like to be able to change the callback of a vibe.d Timer (eg 
created with 
http://vibe-core.dpldocs.info/v1.9.3/vibe.core.core.createTimer.html) after creation, something like:

auto timer = createTimer();
timer.rearm(duration, /*...*/);
timer.callback = delegate {
    // things
}

An alternative method would be to recreate the timer, like so:

auto timer = createTimer();
timer.rearm(duration, /*...*/);
auto timer = createTimer();
timer.rearm(duration - timer.elapsed);

However, I can't find an `elapsed` property or similar in the 
documentation.


More information about the Digitalmars-d-learn mailing list