About
A counter stores start and end times, and implements Display
to either show the time passed since start, or until end,
formatted as HH(+):MM:SS.
The timer will not go down past 00:00:00.
Examples
Basic functionality is very simple:
let now = now;
let mut counter = down;
// A small amount of time will have passed since `now` was assigned
assert_eq!;
counter.flip;
// It now counts up from `start`
assert_eq!
Both start and end times are adjustable:
let mut counter = up;
counter.try_move_start.unwrap;
assert_eq!
Documentation
The full documentation is available here on docs.rs!
Motivation
The primary motivation for the creation of this library is the concept of a marathon livestream, where the stream begins with a timer set to e.g. 4 hours at the beginning, and viewers can increase this time by paying.