index f1a1dd5f9e17add0c03ef2f4fd9ca1f151d5330c..a9ca72f01a2dbfecc34a9251011f1b3afccb0994 100644 (file)
--- a/src/include/core/time.h
+++ b/src/include/core/time.h
* The time, in nano-seconds, since the epoch.
*/
typedef uint64_t sdb_time_t;
-#define PRIscTIME PRIu64
+#define PRIsdbTIME PRIu64
#define SECS_TO_SDB_TIME(s) ((sdb_time_t)(s) * (sdb_time_t)1000000000)
#define SDB_TIME_TO_SECS(t) ((t) / (sdb_time_t)1000000000)
sdb_sleep(sdb_time_t reg, sdb_time_t *rem);
size_t
-sdb_strftime(char *s, size_t len, const char *format, sdb_time_t);
+sdb_strftime(char *s, size_t len, sdb_time_t);
size_t
sdb_strfinterval(char *s, size_t len, sdb_time_t interval);
+/*
+ * sdb_strpunit:
+ * Parse the specified string as a time unit.
+ * "Y" (year), "M" (month), "D" (day), "h" (hour), "m" (minute), "s" (second),
+ * "ms" (milli-second), "us" (micro-second), "ns" (nano-second).
+ *
+ * Returns:
+ * - the time interval corresponding to the specified unit on success
+ * - 0 else
+ */
+sdb_time_t
+sdb_strpunit(const char *s);
+
#ifdef __cplusplus
} /* extern "C" */
#endif