aboutsummaryrefslogtreecommitdiffstats
path: root/src/timer/gettimeofday/tm_unix.cpp
blob: e32df7166d0b56f22e920f23ea5e9bb10c3eacce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*
* Unix Timer
* (C) 1999-2007 Jack Lloyd
*
* Distributed under the terms of the Botan license
*/

#include <botan/tm_unix.h>
#include <botan/util.h>
#include <sys/time.h>

namespace Botan {

/*
* Get the timestamp
*/
u64bit Unix_Timer::clock() const
   {
   struct ::timeval tv;
   ::gettimeofday(&tv, 0);
   return combine_timers(tv.tv_sec, tv.tv_usec, 1000000);
   }

}