summaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-05-24 01:45:54 +0200
committerLennart Poettering <lennart@poettering.net>2010-05-24 01:45:54 +0200
commit871d7de47c13ee6cd78b8eefdf9128be3c740ac0 (patch)
treec92b146f086cdf7a58145e4e744133e645f8c8e0 /src/util.h
parent4288f619215e3dda0b75113d78e4fb7ba219ed58 (diff)
timer: fully implement timer units
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index ccb9769256..b411df0cf2 100644
--- a/src/util.h
+++ b/src/util.h
@@ -32,6 +32,11 @@
typedef uint64_t usec_t;
+typedef struct timestamp {
+ usec_t realtime;
+ usec_t monotonic;
+} timestamp;
+
#define MSEC_PER_SEC 1000ULL
#define USEC_PER_SEC 1000000ULL
#define USEC_PER_MSEC 1000ULL
@@ -49,9 +54,12 @@ typedef uint64_t usec_t;
#define NEWLINE "\n\r"
#define FORMAT_TIMESTAMP_MAX 64
+#define FORMAT_TIMESPAN_MAX 64
usec_t now(clockid_t clock);
+timestamp* timestamp_get(timestamp *ts);
+
usec_t timespec_load(const struct timespec *ts);
struct timespec *timespec_store(struct timespec *ts, usec_t u);
@@ -181,6 +189,7 @@ bool ignore_file(const char *filename);
bool chars_intersect(const char *a, const char *b);
char *format_timestamp(char *buf, size_t l, usec_t t);
+char *format_timespan(char *buf, size_t l, usec_t t);
int make_stdio(int fd);