diff options
author | Kenneth Heafield <github@kheafield.com> | 2012-10-22 12:07:20 +0100 |
---|---|---|
committer | Kenneth Heafield <github@kheafield.com> | 2012-10-22 12:07:20 +0100 |
commit | 5f98fe5c4f2a2090eeb9d30c030305a70a8347d1 (patch) | |
tree | 9b6002f850e6dea1e3400c6b19bb31a9cdf3067f /gi/pyp-topics/src/timing.h | |
parent | cf9994131993b40be62e90e213b1e11e6b550143 (diff) | |
parent | 21825a09d97c2e0afd20512f306fb25fed55e529 (diff) |
Merge remote branch 'upstream/master'
Conflicts:
Jamroot
bjam
decoder/Jamfile
decoder/cdec.cc
dpmert/Jamfile
jam-files/sanity.jam
klm/lm/Jamfile
klm/util/Jamfile
mira/Jamfile
Diffstat (limited to 'gi/pyp-topics/src/timing.h')
-rw-r--r-- | gi/pyp-topics/src/timing.h | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/gi/pyp-topics/src/timing.h b/gi/pyp-topics/src/timing.h deleted file mode 100644 index 08360b0f..00000000 --- a/gi/pyp-topics/src/timing.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef TIMING_H -#define TIMING_H - -#ifdef __CYGWIN__ -# ifndef _POSIX_MONOTONIC_CLOCK -# define _POSIX_MONOTONIC_CLOCK -// this modifies <time.h> -# endif -// in case someone included <time.h> before we got here (this is lifted from time.h>) -# ifndef CLOCK_MONOTONIC -# define CLOCK_MONOTONIC (clockid_t)4 -# endif -#endif - - -#include <time.h> -#include <sys/time.h> -#include "clock_gettime_stub.c" - -struct Timer { - Timer() { Reset(); } - void Reset() - { - clock_gettime(CLOCK_MONOTONIC, &start_t); - } - double Elapsed() const { - timespec end_t; - clock_gettime(CLOCK_MONOTONIC, &end_t); - const double elapsed = (end_t.tv_sec - start_t.tv_sec) - + (end_t.tv_nsec - start_t.tv_nsec) / 1000000000.0; - return elapsed; - } - private: - timespec start_t; -}; - -#endif |