diff options
Diffstat (limited to 'Build/source/libs/icu-xetex/test/usetperf/timer.h')
-rw-r--r-- | Build/source/libs/icu-xetex/test/usetperf/timer.h | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/Build/source/libs/icu-xetex/test/usetperf/timer.h b/Build/source/libs/icu-xetex/test/usetperf/timer.h deleted file mode 100644 index c15ff4e4253..00000000000 --- a/Build/source/libs/icu-xetex/test/usetperf/timer.h +++ /dev/null @@ -1,62 +0,0 @@ -/* -********************************************************************** -* Copyright (c) 2002-2005, International Business Machines -* Corporation and others. All Rights Reserved. -********************************************************************** -* 2002-09-20 aliu Created. -*/ -#ifndef __PERFTIMER_H__ -#define __PERFTIMER_H__ - -#include "unicode/utypes.h" - -// Derived from Ram's perftime.h - -//---------------------------------------------------------------------- -// Win32 - -#if defined(U_WINDOWS) - -#include <windows.h> - -class Timer { - LARGE_INTEGER tstart, tend; -public: - Timer() {} - inline void start() { - QueryPerformanceCounter(&tstart); - } - inline double stop() { - QueryPerformanceCounter(&tend); - LARGE_INTEGER freq; - int result = QueryPerformanceFrequency(&freq); - return ((double)(tend.QuadPart - tstart.QuadPart))/((double)freq.QuadPart); - } -}; - -//---------------------------------------------------------------------- -// UNIX - -#else - -#include <sys/time.h> - -class Timer { - struct timeval tstart, tend; - struct timezone tz; -public: - Timer() {} - inline void start() { - gettimeofday(&tstart, &tz); - } - inline double stop() { - gettimeofday(&tend, &tz); - double t1, t2; - t1 = (double)tstart.tv_sec + (double)tstart.tv_usec*1e-6; - t2 = (double)tend.tv_sec + (double)tend.tv_usec*1e-6; - return t2-t1; - } -}; - -#endif -#endif |