summaryrefslogtreecommitdiff
path: root/src/myTimer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/myTimer.c')
-rw-r--r--src/myTimer.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/myTimer.c b/src/myTimer.c
index 04abef0..ea83fd5 100644
--- a/src/myTimer.c
+++ b/src/myTimer.c
@@ -30,15 +30,13 @@ void initTimer()
my_time_t getMyTime()
{
- static struct timeval start;
+ static struct timeval start = { .tv_sec = 0, .tv_usec = 0 };
struct timeval now;
- static char first = '0';
my_time_t ticks;
- if( first == '0' )
+ if( start.tv_sec == 0 && start.tv_usec == 0 )
{
gettimeofday(&start, NULL);
- first = 'x';
}
gettimeofday(&now, NULL);