Added Util::getNTP() to timing library.
This commit is contained in:
parent
54c31922f7
commit
6c54546048
2 changed files with 7 additions and 0 deletions
|
@ -35,6 +35,12 @@ void Util::sleep(int ms){
|
|||
nanosleep( &T, 0);
|
||||
}
|
||||
|
||||
long long Util::getNTP(){
|
||||
struct timespec t;
|
||||
clock_gettime(CLOCK_REALTIME, &t);
|
||||
return ((((long long int)t.tv_sec) + 2208988800) << 32) + (t.tv_nsec*4.2949);
|
||||
}
|
||||
|
||||
/// Gets the current time in milliseconds.
|
||||
long long int Util::getMS(){
|
||||
struct timespec t;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue