diff options
author | David Clark <david.a.clark@nokia.com> | 2010-11-18 16:20:48 +1000 |
---|---|---|
committer | David Clark <david.a.clark@nokia.com> | 2010-11-18 16:20:48 +1000 |
commit | c223232bc15106750da632598047a35ad3762723 (patch) | |
tree | 403f7aa2c3a5a912edce6feae869046c89d29178 /old/botan/src/timer/win32_query_perf_ctr | |
parent | b984b0b62076067f1f75db5a7eda5aaa2cdaad2a (diff) |
Diffstat (limited to 'old/botan/src/timer/win32_query_perf_ctr')
-rw-r--r-- | old/botan/src/timer/win32_query_perf_ctr/info.txt | 26 | ||||
-rw-r--r-- | old/botan/src/timer/win32_query_perf_ctr/tm_win32.cpp | 23 | ||||
-rw-r--r-- | old/botan/src/timer/win32_query_perf_ctr/tm_win32.h | 27 |
3 files changed, 76 insertions, 0 deletions
diff --git a/old/botan/src/timer/win32_query_perf_ctr/info.txt b/old/botan/src/timer/win32_query_perf_ctr/info.txt new file mode 100644 index 0000000..4bb1ddb --- /dev/null +++ b/old/botan/src/timer/win32_query_perf_ctr/info.txt @@ -0,0 +1,26 @@ +realname "Win32 Timer" + +define TIMER_WIN32 +modset win32 + +load_on auto + +<add> +tm_win32.cpp +tm_win32.h +</add> + +<os> +cygwin +windows +mingw +</os> + +<libs> +windows -> user32.lib +</libs> + +<requires> +timer +</requires> + diff --git a/old/botan/src/timer/win32_query_perf_ctr/tm_win32.cpp b/old/botan/src/timer/win32_query_perf_ctr/tm_win32.cpp new file mode 100644 index 0000000..6b878e6 --- /dev/null +++ b/old/botan/src/timer/win32_query_perf_ctr/tm_win32.cpp @@ -0,0 +1,23 @@ +/* +* Win32 Timer +* (C) 1999-2007 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + +#include <botan/tm_win32.h> +#include <windows.h> + +namespace Botan { + +/* +* Get the timestamp +*/ +u64bit Win32_Timer::clock() const + { + LARGE_INTEGER tv; + ::QueryPerformanceCounter(&tv); + return tv.QuadPart; + } + +} diff --git a/old/botan/src/timer/win32_query_perf_ctr/tm_win32.h b/old/botan/src/timer/win32_query_perf_ctr/tm_win32.h new file mode 100644 index 0000000..5bcb720 --- /dev/null +++ b/old/botan/src/timer/win32_query_perf_ctr/tm_win32.h @@ -0,0 +1,27 @@ +/* +* Win32 Timer +* (C) 1999-2007 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + +#ifndef BOTAN_TIMER_WIN32_H__ +#define BOTAN_TIMER_WIN32_H__ + +#include <botan/timer.h> + +namespace Botan { + +/* +* Win32 Timer +*/ +class BOTAN_DLL Win32_Timer : public Timer + { + public: + std::string name() const { return "Win32 QueryPerformanceCounter"; } + u64bit clock() const; + }; + +} + +#endif |