aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcu_utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/pcu_utils.h')
-rw-r--r--src/pcu_utils.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/pcu_utils.h b/src/pcu_utils.h
index 84c545b..5ca234a 100644
--- a/src/pcu_utils.h
+++ b/src/pcu_utils.h
@@ -19,3 +19,8 @@
inline int msecs_to_frames(int msecs) {
return (msecs * (1024 * 1000 / 4615)) / 1024;
}
+
+inline void csecs_to_timeval(unsigned csecs, struct timeval *tv) {
+ tv->tv_sec = csecs / 100;
+ tv->tv_usec = (csecs % 100) * 10000;
+}