timer 0.2.0
A simple countdown timer
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
timer
A simple D implementation of countdown and stopwatch timer
Usage
StopWatch
import core.thread;
import std.stdio;
import timer;
void main(string[] args) {
StopWatchTimer sw;
sw.start();
Thread.sleep(dur!("msecs")(200));
writefln("elapsed %d ms", sw.elapsedMsecs);
Thread.sleep(dur!("msecs")(150));
sw.stop();
writefln("elapsed %s", sw.elapsed);
sw.reset();
writefln("after reset elapsed %d ms", sw.elapsedMsecs);
writeln();
writeln("restart...");
sw.restart();
Thread.sleep(dur!("msecs")(150));
writefln("After restart elapsed %d ms", sw.elapsedMsecs);
}
CountdownTimer
import core.thread;
import std.stdio;
import timer;
void main(string[] args) {
Countdown countms;
countms.start(200);
while (!countms.isOver) {
Thread.sleep(dur!("msecs")(10));
writefln("elapsed %7.3f ms remaining %7.3f ms", countms.elapsedTime, countms.remainingTime);
}
}
see also examplesxamples/) directory.
Libraries
License
Distributed under the Boost Software License, Version 1.0. See copy at http://www.boost.org/LICENSE10.txt.
- Registered by o3o
- 0.2.0 released 8 years ago
- o3o/timer
- Boost
- Copyright © 2016, Orfeo Da Viá
- Authors:
- Dependencies:
- none
- Versions:
-
0.6.1 2018-Apr-12 0.6.0 2018-Mar-01 0.5.0 2018-Jan-24 0.4.1 2017-Jul-26 0.4.0 2017-Jul-25 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
0 downloads this month
-
242 downloads total
-
- Score:
- 0.8
- Short URL:
- timer.dub.pm