summaryrefslogtreecommitdiff
path: root/libs/ardour/globals.cc
diff options
context:
space:
mode:
authorJohn Emmas <johne53@tiscali.co.uk>2013-09-18 12:27:39 +0100
committerJohn Emmas <johne53@tiscali.co.uk>2013-09-18 12:27:39 +0100
commit4f8c30de020ed00997776e1bdb6a1c97724c2c97 (patch)
treec62037cf0e941febc8f54db38e2ce35dc2adc1e0 /libs/ardour/globals.cc
parentb5da5a1af0ea532587e10e91bebe917adb7520e9 (diff)
'libs/ardour' - Further platform specific changes
Diffstat (limited to 'libs/ardour/globals.cc')
-rw-r--r--libs/ardour/globals.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/libs/ardour/globals.cc b/libs/ardour/globals.cc
index 8646b819f3..0cda9ebdf4 100644
--- a/libs/ardour/globals.cc
+++ b/libs/ardour/globals.cc
@@ -584,10 +584,21 @@ clock_gettime (int /*clk_id*/, struct timespec *t)
microseconds_t
ARDOUR::get_microseconds ()
{
+#ifdef PLATFORM_WINDOWS
+ microseconds_t ret = 0;
+ LARGE_INTEGER freq, time;
+
+ if (QueryPerformanceFrequency(&freq))
+ if (QueryPerformanceCounter(&time))
+ ret = (microseconds_t)((time.QuadPart * 1000000) / freq.QuadPart);
+
+ return ret;
+#else
struct timespec ts;
if (clock_gettime (CLOCK_MONOTONIC, &ts) != 0) {
/* EEEK! */
return 0;
}
return (microseconds_t) ts.tv_sec * 1000000 + (ts.tv_nsec/1000);
+#endif
}