19.03.2013 - Version 0.3.0 ported to Mac OS X

This commit is contained in:
peri4
2013-03-19 21:01:47 +04:00
parent 66c53a27fc
commit 02c629d6a8
10 changed files with 59 additions and 488 deletions

View File

@@ -38,6 +38,10 @@ public:
double toMilliseconds() const {return seconds * 1.e+3 + nanoseconds / 1.e+6;}
double toMicroseconds() const {return seconds * 1.e+6 + nanoseconds / 1.e+3;}
double toNanoseconds() const {return seconds * 1.e+9 + double(nanoseconds);}
PISystemTime & addSeconds(double v) {*this += fromSeconds(v); return *this;}
PISystemTime & addMilliseconds(double v) {*this += fromMilliseconds(v); return *this;}
PISystemTime & addMicroseconds(double v) {*this += fromMicroseconds(v); return *this;}
PISystemTime & addNanoseconds(double v) {*this += fromNanoseconds(v); return *this;}
void sleep() {piUSleep(piFloord(toMicroseconds()));} // wait self value, useful to wait some dT = (t1 - t0)
PISystemTime abs() const {return PISystemTime(piAbsl(seconds), piAbsl(nanoseconds));}
PISystemTime operator +(const PISystemTime & t) {PISystemTime tt(*this); tt.seconds += t.seconds; tt.nanoseconds += t.nanoseconds; tt.checkOverflows(); return tt;}