17 mvprintw(x,y,
"%d:%02d:%02d",
18 std::chrono::duration_cast<std::chrono::minutes>(d).count(),
19 std::chrono::duration_cast<std::chrono::seconds>(d).count()%60,
20 (std::chrono::duration_cast<std::chrono::milliseconds>(d).count()%1000)/10
34 emit(Event(
"start/stop"));
44 std::cout <<
"halting\n";
51 mvprintw(3,1,
"start/stop(s), lap(l), reset(r), quit(q)");
52 for (
int i=0; i<_stopwatch.
laps().size(); i++ ) {
53 mvprintw(5+i, 1,
"Lap %d", _stopwatch.
laps().size()-i);
const vector< high_resolution_clock::duration > & laps()
Get a list of lap times.
void show_time(int x, int y, high_resolution_clock::duration d)
Display the time at the given x,y position on the screen.
UserInterface(StopWatch &sw)
void update()
Update the user interface by (a) reading keyboard input and (b) writing to the screen.
high_resolution_clock::duration value()
Get the time stored by the stopwatch.
A stop watch class, that inherits from StateMachine.