diff options
Diffstat (limited to 'src/timer/win32_query_perf_ctr')
-rw-r--r-- | src/timer/win32_query_perf_ctr/modinfo.txt | 20 | ||||
-rw-r--r-- | src/timer/win32_query_perf_ctr/tm_win32.cpp | 21 | ||||
-rw-r--r-- | src/timer/win32_query_perf_ctr/tm_win32.h | 24 |
3 files changed, 65 insertions, 0 deletions
diff --git a/src/timer/win32_query_perf_ctr/modinfo.txt b/src/timer/win32_query_perf_ctr/modinfo.txt new file mode 100644 index 000000000..74c4a59ea --- /dev/null +++ b/src/timer/win32_query_perf_ctr/modinfo.txt @@ -0,0 +1,20 @@ +realname "Win32 Timer" + +define TIMER_WIN32 +modset win32 + +load_on auto + +<add> +tm_win32.cpp +tm_win32.h +</add> + +<os> +cygwin +windows +</os> + +<libs> +windows -> user32 +</libs> diff --git a/src/timer/win32_query_perf_ctr/tm_win32.cpp b/src/timer/win32_query_perf_ctr/tm_win32.cpp new file mode 100644 index 000000000..58f7b0f55 --- /dev/null +++ b/src/timer/win32_query_perf_ctr/tm_win32.cpp @@ -0,0 +1,21 @@ +/************************************************* +* Win32 Timer Source File * +* (C) 1999-2007 Jack Lloyd * +*************************************************/ + +#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/src/timer/win32_query_perf_ctr/tm_win32.h b/src/timer/win32_query_perf_ctr/tm_win32.h new file mode 100644 index 000000000..67b045e78 --- /dev/null +++ b/src/timer/win32_query_perf_ctr/tm_win32.h @@ -0,0 +1,24 @@ +/************************************************* +* Win32 Timer Header File * +* (C) 1999-2007 Jack Lloyd * +*************************************************/ + +#ifndef BOTAN_TIMER_WIN32_H__ +#define BOTAN_TIMER_WIN32_H__ + +#include <botan/timers.h> + +namespace Botan { + +/************************************************* +* Win32 Timer * +*************************************************/ +class Win32_Timer : public Timer + { + public: + u64bit clock() const; + }; + +} + +#endif |