diff options
author | Andrew Duggan <aduggan@synaptics.com> | 2014-04-04 16:59:54 -0700 |
---|---|---|
committer | Andrew Duggan <aduggan@synaptics.com> | 2014-04-04 16:59:54 -0700 |
commit | 65e5553ace01906e5c0ac3a810afd552a2820acd (patch) | |
tree | 47bef351c093df7dcd94152908c646ee44fc0f64 /rmidevice | |
parent | caf09dec5c3b56c83e39b2f1031712342dbe37ea (diff) | |
download | rmi4utils-65e5553ace01906e5c0ac3a810afd552a2820acd.tar.gz |
Implement timing, this time in microseconds.
Diffstat (limited to 'rmidevice')
-rw-r--r-- | rmidevice/rmidevice.cpp | 8 | ||||
-rw-r--r-- | rmidevice/rmidevice.h | 2 |
2 files changed, 10 insertions, 0 deletions
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 @@ int RMIDevice::ScanPDT() } 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 diff --git a/rmidevice/rmidevice.h b/rmidevice/rmidevice.h index ca97b48..de17212 100644 --- a/rmidevice/rmidevice.h +++ b/rmidevice/rmidevice.h @@ -63,4 +63,6 @@ protected: int m_bytesPerReadRequest; }; +long long diff_time(struct timespec *start, struct timespec *end); + #endif /* _RMIDEVICE_H_ */
\ No newline at end of file |