Commit in projects/lcdd/trunk/include/lcdd/util on MAIN | |||
TimeUtil.hh | +17 | added 3002 |
Add TimeUtil class for getting nano time when performance debugging.
--- projects/lcdd/trunk/include/lcdd/util/TimeUtil.hh (rev 0) +++ projects/lcdd/trunk/include/lcdd/util/TimeUtil.hh 2014-02-14 22:59:35 UTC (rev 3002) @@ -0,0 +1,17 @@
+#ifndef lcdd_util_TimeUtil_hh_ +#define lcdd_util_TimeUtil_hh_ + +#include <sys/time.h> + +class TimeUtil { + +public: + + static long getNanoTime() { + timespec ts; + clock_gettime(CLOCK_REALTIME, &ts); + return ts.tv_nsec; + } +}; + +#endif