Lines 117-123
Link Here
|
117 |
POV_LONG TimerDefault::ElapsedRealTime() const |
117 |
POV_LONG TimerDefault::ElapsedRealTime() const |
118 |
{ |
118 |
{ |
119 |
boost::xtime t; |
119 |
boost::xtime t; |
120 |
boost::xtime_get(&t, boost::TIME_UTC); |
120 |
boost::xtime_get(&t, boost::TIME_UTC_); |
121 |
POV_LONG tt = (POV_LONG)(t.sec) * (POV_LONG)(1000000000) + (POV_LONG)(t.nsec); |
121 |
POV_LONG tt = (POV_LONG)(t.sec) * (POV_LONG)(1000000000) + (POV_LONG)(t.nsec); |
122 |
POV_LONG st = (POV_LONG)(realTimeStart.sec) * (POV_LONG)(1000000000) + (POV_LONG)(realTimeStart.nsec); |
122 |
POV_LONG st = (POV_LONG)(realTimeStart.sec) * (POV_LONG)(1000000000) + (POV_LONG)(realTimeStart.nsec); |
123 |
return ((tt - st) / (POV_LONG)(1000000)); |
123 |
return ((tt - st) / (POV_LONG)(1000000)); |
Lines 126-132
Link Here
|
126 |
POV_LONG TimerDefault::ElapsedCPUTime() const |
126 |
POV_LONG TimerDefault::ElapsedCPUTime() const |
127 |
{ |
127 |
{ |
128 |
boost::xtime t; |
128 |
boost::xtime t; |
129 |
boost::xtime_get(&t, boost::TIME_UTC); |
129 |
boost::xtime_get(&t, boost::TIME_UTC_); |
130 |
POV_LONG tt = (POV_LONG)(t.sec) * (POV_LONG)(1000000000) + (POV_LONG)(t.nsec); |
130 |
POV_LONG tt = (POV_LONG)(t.sec) * (POV_LONG)(1000000000) + (POV_LONG)(t.nsec); |
131 |
POV_LONG st = (POV_LONG)(cpuTimeStart.sec) * (POV_LONG)(1000000000) + (POV_LONG)(cpuTimeStart.nsec); |
131 |
POV_LONG st = (POV_LONG)(cpuTimeStart.sec) * (POV_LONG)(1000000000) + (POV_LONG)(cpuTimeStart.nsec); |
132 |
return ((tt - st) / (POV_LONG)(1000000)); |
132 |
return ((tt - st) / (POV_LONG)(1000000)); |
Lines 139-146
Link Here
|
139 |
|
139 |
|
140 |
void TimerDefault::Reset() |
140 |
void TimerDefault::Reset() |
141 |
{ |
141 |
{ |
142 |
boost::xtime_get(&realTimeStart, boost::TIME_UTC); |
142 |
boost::xtime_get(&realTimeStart, boost::TIME_UTC_); |
143 |
boost::xtime_get(&cpuTimeStart, boost::TIME_UTC); |
143 |
boost::xtime_get(&cpuTimeStart, boost::TIME_UTC_); |
144 |
} |
144 |
} |
145 |
|
145 |
|
146 |
} |
146 |
} |
Lines 155-161
Link Here
|
155 |
void Delay(unsigned int msec) |
155 |
void Delay(unsigned int msec) |
156 |
{ |
156 |
{ |
157 |
boost::xtime t; |
157 |
boost::xtime t; |
158 |
boost::xtime_get(&t, boost::TIME_UTC); |
158 |
boost::xtime_get(&t, boost::TIME_UTC_); |
159 |
POV_ULONG ns = (POV_ULONG)(t.sec) * (POV_ULONG)(1000000000) + (POV_ULONG)(t.nsec) + (POV_ULONG)(msec) * (POV_ULONG)(1000000); |
159 |
POV_ULONG ns = (POV_ULONG)(t.sec) * (POV_ULONG)(1000000000) + (POV_ULONG)(t.nsec) + (POV_ULONG)(msec) * (POV_ULONG)(1000000); |
160 |
t.sec = (boost::xtime::xtime_sec_t)(ns / (POV_ULONG)(1000000000)); |
160 |
t.sec = (boost::xtime::xtime_sec_t)(ns / (POV_ULONG)(1000000000)); |
161 |
t.nsec = (boost::xtime::xtime_nsec_t)(ns % (POV_ULONG)(1000000000)); |
161 |
t.nsec = (boost::xtime::xtime_nsec_t)(ns % (POV_ULONG)(1000000000)); |