]> git.donarmstrong.com Git - mothur.git/blobdiff - timing.h
1.21.0
[mothur.git] / timing.h
index b566e1b801a932374736991076457f0efd9dda4c..4db7847346356b41a8a12a9e226413f2e81abecb 100644 (file)
--- a/timing.h
+++ b/timing.h
@@ -1,3 +1,5 @@
+//uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.
+
 #define TIMING 0
 #ifndef timing_h
 #define timing_h
@@ -57,30 +59,29 @@ const unsigned AllocerCount =
 #undef A
        ;
 
-#ifdef _MSC_VER
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+typedef uint64_t TICKS;
+__inline__ uint64_t GetClockTicks()
+{
+       uint32_t lo, hi;
+       /* We cannot use "=A", since this would use %rax on x86_64 */
+       __asm__ __volatile__ ("rdtsc" : "=a" (lo), "=d" (hi));
+       return (uint64_t)hi << 32 | lo;
+}
+
 
+#else  // ifdef _MSC_VER
 typedef unsigned __int64 TICKS;
 
 #pragma warning(disable:4035)
 inline TICKS GetClockTicks()
-       {
+{
        _asm
-               {
+       {
                _emit   0x0f
                _emit   0x31
-               }
-       }
-
-#else  // ifdef _MSC_VER
-
-typedef uint64_t TICKS;
-__inline__ uint64_t GetClockTicks()
-       {
-       uint32_t lo, hi;
-       /* We cannot use "=A", since this would use %rax on x86_64 */
-       __asm__ __volatile__ ("rdtsc" : "=a" (lo), "=d" (hi));
-       return (uint64_t)hi << 32 | lo;
        }
+}
 
 #endif // ifdef _MSC_VER