diff options
author | Michael J. Chudobiak <mjc@avtechpulse.com> | 2012-08-30 11:38:48 -0400 |
---|---|---|
committer | Michael J. Chudobiak <mjc@avtechpulse.com> | 2012-08-30 11:38:48 -0400 |
commit | d6c71646ddc4a34293bb5cadde78a30806d8eace (patch) | |
tree | 11ab0d737aca55ccf3e96df40cd8624f75c85dfd /globals.c | |
parent | 996f3d52275475f2478f377f12f0ef7571ecc795 (diff) |
first attempt at lcd menus
Diffstat (limited to 'globals.c')
-rw-r--r-- | globals.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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; +} |