nsnake
Classic snake game for the terminal
Public Member Functions | Protected Attributes | List of all members
Timer Class Reference

Public Member Functions

void start ()
 Sets a starting point for the timer. More...
 
void pause ()
 Temporarily stops the timer.
 
void unpause ()
 Restarts the timer if it was paused.
 
bool isRunning ()
 Tells if the timer's still running (hasn't called stop())
 
bool isPaused ()
 Tells if the timer's paused.
 
suseconds_t delta_us ()
 Returns the whole timer's difference in milisseconds.
 
suseconds_t delta_ms ()
 Returns the milisseconds part of the timer's difference.
 
suseconds_t delta_s ()
 Returns the seconds part of the timer's difference.
 

Protected Attributes

suseconds_t startMark
 
suseconds_t stopMark
 
suseconds_t pausedMark
 
bool running
 
bool paused
 

Detailed Description

Definition at line 7 of file Timer.hpp.

Member Function Documentation

void Timer::start ( )

Sets a starting point for the timer.

If called multiple times, will restart.

Definition at line 26 of file Timer.cpp.


The documentation for this class was generated from the following files: