17.10.2013 - Adjusted for QNX, PIPeer release for Windows, Remote console
This commit is contained in:
29
pitimer.cpp
29
pitimer.cpp
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*ccc
|
||||
PIP - Platform Independent Primitives
|
||||
Timer
|
||||
Copyright (C) 2013 Ivan Pelipenko peri4ko@gmail.com
|
||||
@@ -20,6 +20,33 @@
|
||||
#include "pitimer.h"
|
||||
#include "pisystemtests.h"
|
||||
|
||||
|
||||
/*! \class PITimer
|
||||
* \brief Timer
|
||||
*
|
||||
* \section PITimer_sec0 Synopsis
|
||||
* This class implements timer function. PIP timers supports 3 way to tick notify,
|
||||
* frequency delimiters and time measurements.
|
||||
* \section PITimer_sec1 Notify variants
|
||||
* Notify variants:
|
||||
* * "slot" - static function with format void func(void * data, int delimiter);
|
||||
* * event - \a void timeout(void * data, int delimiter);
|
||||
* * virtual function - \a void tick(void * data, int delimiter).
|
||||
* All this variant are equivalent, use most applicable.
|
||||
* \section PITimer_sec2 Frequency delimiters
|
||||
* Frequency delimiter is an integer number and "slot" function. If "slot" function is null
|
||||
* timer main "slot" will be used. Each delimiter numbers tick timer will be execute
|
||||
* delimiters or timer main "slot" function with \b delimiter value = delimiter number.
|
||||
* Example: \snippet pitimer.cpp delimiter
|
||||
* \section PITimer_sec3 Time measurements
|
||||
* PITimer can be used as time measurer. Function \a reset() set time mark to current
|
||||
* system time, then functions double elapsed_*() returns time elapsed from this mark.
|
||||
* These functions can returns nano-, micro-, milli- and seconds with suffixes "n", "u", "m"
|
||||
* and "s";
|
||||
* Example: \snippet pitimer.cpp elapsed
|
||||
*/
|
||||
|
||||
|
||||
bool operator ==(const PITime & t0, const PITime & t1) {
|
||||
return (t0.hours == t1.hours && t0.minutes == t1.minutes && t0.seconds == t1.seconds);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user