source:
vis_dev/sharpSAT/src/shared/SomeTime.cpp
Last change on this file was 29, checked in by , 13 years ago | |
---|---|
File size: 400 bytes |
Rev | Line | |
---|---|---|
[29] | 1 | #include "SomeTime.h" |
2 | ||
3 | int CStepTime::timeVal = 0; | |
4 | ||
5 | ||
6 | ||
7 | bool diffTimes(timeval& ret, const timeval &tLater, const timeval &tEarlier) | |
8 | { | |
9 | long int ad = 0; | |
10 | long int bd = 0; | |
11 | ||
12 | if(tLater.tv_usec < tEarlier.tv_usec) | |
13 | { | |
14 | ad = 1; | |
15 | bd = 1000000; | |
16 | } | |
17 | ret.tv_sec = tLater.tv_sec - ad - tEarlier.tv_sec; | |
18 | ret.tv_usec = tLater.tv_usec + bd - tEarlier.tv_usec; | |
19 | return true; | |
20 | } |
Note: See TracBrowser
for help on using the repository browser.