summaryrefslogtreecommitdiffstats
path: root/old/botan/src/timer/gettimeofday/tm_unix.cpp
diff options
context:
space:
mode:
authorDavid Clark <david.a.clark@nokia.com>2010-11-18 16:20:48 +1000
committerDavid Clark <david.a.clark@nokia.com>2010-11-18 16:20:48 +1000
commitc223232bc15106750da632598047a35ad3762723 (patch)
tree403f7aa2c3a5a912edce6feae869046c89d29178 /old/botan/src/timer/gettimeofday/tm_unix.cpp
parentb984b0b62076067f1f75db5a7eda5aaa2cdaad2a (diff)
Mark repository as deprecatedHEADmaster
Diffstat (limited to 'old/botan/src/timer/gettimeofday/tm_unix.cpp')
-rw-r--r--old/botan/src/timer/gettimeofday/tm_unix.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/old/botan/src/timer/gettimeofday/tm_unix.cpp b/old/botan/src/timer/gettimeofday/tm_unix.cpp
new file mode 100644
index 0000000..e32df71
--- /dev/null
+++ b/old/botan/src/timer/gettimeofday/tm_unix.cpp
@@ -0,0 +1,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);
+ }
+
+}