diff --git a/src/core/pitime.h b/src/core/pitime.h index 0484003d..270a24e5 100755 --- a/src/core/pitime.h +++ b/src/core/pitime.h @@ -60,7 +60,7 @@ public: PISystemTime() {seconds = nanoseconds = 0;} //! Contructs system time with s = "s" and ns = "ns" - PISystemTime(long s, long ns) {seconds = s; nanoseconds = ns; checkOverflows();} + PISystemTime(int s, int ns) {seconds = s; nanoseconds = ns; checkOverflows();} //! Contructs system time from another PISystemTime(const PISystemTime & t) {seconds = t.seconds; nanoseconds = t.nanoseconds;} @@ -148,25 +148,25 @@ public: //! Contructs system time from seconds "v" - static PISystemTime fromSeconds(double v) {long s = piFloord(v); return PISystemTime(s, (v - s) * 1000000000);} + static PISystemTime fromSeconds(double v) {int s = piFloord(v); return PISystemTime(s, (v - s) * 1000000000);} //! Contructs system time from milliseconds "v" - static PISystemTime fromMilliseconds(double v) {long s = piFloord(v / 1000.); return PISystemTime(s, (v / 1000. - s) * 1000000000);} + static PISystemTime fromMilliseconds(double v) {int s = piFloord(v / 1000.); return PISystemTime(s, (v / 1000. - s) * 1000000000);} //! Contructs system time from microseconds "v" - static PISystemTime fromMicroseconds(double v) {long s = piFloord(v / 1000000.); return PISystemTime(s, (v / 1000000. - s) * 1000000000);} + static PISystemTime fromMicroseconds(double v) {int s = piFloord(v / 1000000.); return PISystemTime(s, (v / 1000000. - s) * 1000000000);} //! Contructs system time from nanoseconds "v" - static PISystemTime fromNanoseconds(double v) {long s = piFloord(v / 1000000000.); return PISystemTime(s, (v / 1000000000. - s) * 1000000000);} + static PISystemTime fromNanoseconds(double v) {int s = piFloord(v / 1000000000.); return PISystemTime(s, (v / 1000000000. - s) * 1000000000);} //! Returns current system time static PISystemTime current(bool precise_but_not_system = false); //! Seconds of stored system time - long seconds; + int seconds; //! Nanoseconds of stored system time - long nanoseconds; + int nanoseconds; private: void checkOverflows() {while (nanoseconds >= 1000000000) {nanoseconds -= 1000000000; seconds++;} while (nanoseconds < 0) {nanoseconds += 1000000000; seconds--;}}