summaryrefslogtreecommitdiff
path: root/meme/time.h
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2014-09-12 13:29:01 (GMT)
committerWerner Almesberger <werner@almesberger.net>2014-09-12 13:29:01 (GMT)
commit60c8902fe151eb4b87796badf68eb3bea60cf58e (patch)
tree75cb69a7fb6dd5ff05e044f46912e115ac53b304 /meme/time.h
parent173e5325d1968ff88a0788c8d1248841dd381f15 (diff)
downloadmisc-60c8902fe151eb4b87796badf68eb3bea60cf58e.zip
misc-60c8902fe151eb4b87796badf68eb3bea60cf58e.tar.gz
misc-60c8902fe151eb4b87796badf68eb3bea60cf58e.tar.bz2
meme/time.h, meme/time.c: utilities to measure program execution time
Diffstat (limited to 'meme/time.h')
-rw-r--r--meme/time.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/meme/time.h b/meme/time.h
new file mode 100644
index 0000000..e4c244e
--- /dev/null
+++ b/meme/time.h
@@ -0,0 +1,29 @@
+/*
+ * time.h - Timing of program execution
+ *
+ * Written 2014 by Werner Almesberger
+ * Copyright 2014 by Werner Almesberger
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+
+#ifndef TIME_H
+#define TIME_H
+
+#include <sys/time.h>
+
+
+struct time {
+ struct timeval tv;
+};
+
+
+void time_start(struct time *t);
+void time_stop(struct time *t);
+unsigned time_ms(const struct time *t);
+
+#endif /* !TIME_H */