summaryrefslogtreecommitdiff
path: root/globals.c
diff options
context:
space:
mode:
authorMichael J. Chudobiak <mjc@avtechpulse.com>2012-08-30 11:38:48 -0400
committerMichael J. Chudobiak <mjc@avtechpulse.com>2012-08-30 11:38:48 -0400
commitd6c71646ddc4a34293bb5cadde78a30806d8eace (patch)
tree11ab0d737aca55ccf3e96df40cd8624f75c85dfd /globals.c
parent996f3d52275475f2478f377f12f0ef7571ecc795 (diff)
first attempt at lcd menus
Diffstat (limited to 'globals.c')
-rw-r--r--globals.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/globals.c b/globals.c
index c0be662..d66d730 100644
--- a/globals.c
+++ b/globals.c
@@ -1,5 +1,6 @@
#include "globals.h"
#include <time.h>
+#include <sys/time.h>
GlobalStruct globals = {
@@ -19,3 +20,16 @@ long sec_timer (void)
{
return (long)time(NULL);
}
+
+
+unsigned long long ms_timer (void)
+{
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+
+ unsigned long long millisecondsSinceEpoch =
+ (unsigned long long)(tv.tv_sec) * 1000 +
+ (unsigned long long)(tv.tv_usec) / 1000;
+
+ return millisecondsSinceEpoch;
+}