Print UTF-8 SI suffix only when allowed by the locale
[lttng-tools.git] / src / common / time.h
index 8a7dd958ffeeb6b86ef4a1ce1b11cf1c10a6a42b..894ab9259a135a3f7816d74e3475d268ec328b13 100644 (file)
 #define LTTNG_TIME_H
 
 #include <time.h>
+#include <stdbool.h>
 
 #define MSEC_PER_SEC   1000ULL
 #define NSEC_PER_SEC   1000000000ULL
 #define NSEC_PER_MSEC  1000000ULL
 #define NSEC_PER_USEC  1000ULL
 
+bool locale_supports_utf8(void);
+
+#define NSEC_UNIT       "ns"
+#define USEC_UNIT       (locale_supports_utf8() ? "µs" : "us")
+#define MSEC_UNIT       "ms"
+#define SEC_UNIT        "s"
+#define MIN_UNIT        "m"
+#define HR_UNIT         "h"
+
 /*
  * timespec_to_ms: Convert timespec to milliseconds.
  *
This page took 0.023167 seconds and 4 git commands to generate.