[PATCH] hrtimer: hrtimer core code
[deliverable/linux.git] / include / linux / ktime.h
index 5b9a9eb82baabbf03a6abc7a0087a2d4d9272d8a..222a047cc145e8d25c8d68894c86bc390d2a929b 100644 (file)
@@ -266,4 +266,19 @@ static inline u64 ktime_to_ns(const ktime_t kt)
 
 #endif
 
+/*
+ * The resolution of the clocks. The resolution value is returned in
+ * the clock_getres() system call to give application programmers an
+ * idea of the (in)accuracy of timers. Timer values are rounded up to
+ * this resolution values.
+ */
+#define KTIME_REALTIME_RES     (NSEC_PER_SEC/HZ)
+#define KTIME_MONOTONIC_RES    (NSEC_PER_SEC/HZ)
+
+/* Get the monotonic time in timespec format: */
+extern void ktime_get_ts(struct timespec *ts);
+
+/* Get the real (wall-) time in timespec format: */
+#define ktime_get_real_ts(ts)  getnstimeofday(ts)
+
 #endif
This page took 0.025009 seconds and 5 git commands to generate.