miosix::Timer Class Reference
[Syncronization]
#include <sync.h>
List of all members.
Detailed Description
A timer that can be used to measure time intervals.
Its resolution equals the kernel tick.
Maximum interval is 2^31-1 ticks.
Constructor & Destructor Documentation
Constructor. Timer is initialized in stopped status.
Member Function Documentation
void miosix::Timer::clear |
( |
|
) |
|
Clear the timer and set it to not running state.
int miosix::Timer::interval |
( |
|
) |
const |
get the interval, in kernel ticks.
- Returns:
- the number of tick between start and stop. Returns -1 if the timer was never started, if interval is called after start but before stop, or if it overflowed.
To read the vaue of a timer without stopping it, you can use its copy constructor to create another timer, and stop it while the first timer keeps running.
bool miosix::Timer::is_running |
( |
|
) |
const |
- Returns:
- true if timer is running
void miosix::Timer::start |
( |
|
) |
|
void miosix::Timer::stop |
( |
|
) |
|
Stop the timer. After stop, Timer can be started and stopped again to count non-contiguous timer intervals.
The documentation for this class was generated from the following files:
- /Users/fede/Documents/Projects/ARM/miosix/miosix_np_2/miosix/kernel/sync.h
- /Users/fede/Documents/Projects/ARM/miosix/miosix_np_2/miosix/kernel/sync.cpp