commit | 65e5553ace01906e5c0ac3a810afd552a2820acd | [log] [tgz] |
---|---|---|
author | Andrew Duggan <aduggan@synaptics.com> | Fri Apr 04 16:59:54 2014 -0700 |
committer | Andrew Duggan <aduggan@synaptics.com> | Fri Apr 04 16:59:54 2014 -0700 |
tree | 47bef351c093df7dcd94152908c646ee44fc0f64 | |
parent | caf09dec5c3b56c83e39b2f1031712342dbe37ea [diff] [blame] |
Implement timing, this time in microseconds.
diff --git a/rmidevice/rmidevice.cpp b/rmidevice/rmidevice.cpp index 93fe043..d955e81 100644 --- a/rmidevice/rmidevice.cpp +++ b/rmidevice/rmidevice.cpp
@@ -258,4 +258,12 @@ } return 0; +} + +long long diff_time(struct timespec *start, struct timespec *end) +{ + long long diff; + diff = (end->tv_sec - start->tv_sec) * 1000 * 1000; + diff += (end->tv_nsec - start->tv_nsec) / 1000; + return diff; } \ No newline at end of file