From d6c71646ddc4a34293bb5cadde78a30806d8eace Mon Sep 17 00:00:00 2001 From: "Michael J. Chudobiak" Date: Thu, 30 Aug 2012 11:38:48 -0400 Subject: first attempt at lcd menus --- globals.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'globals.c') 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 +#include 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; +} -- cgit