From 2023a692d449503873356d5658e07d52d2a0ebc4 Mon Sep 17 00:00:00 2001 From: adamdunkels Date: Wed, 9 Jul 2008 09:34:29 +0000 Subject: [PATCH] Added clock_second() implementation to make th shell work --- platform/native/clock.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/platform/native/clock.c b/platform/native/clock.c index 4c4550eb3..335d223a7 100644 --- a/platform/native/clock.c +++ b/platform/native/clock.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: clock.c,v 1.1 2006/06/17 22:41:31 adamdunkels Exp $ + * $Id: clock.c,v 1.2 2008/07/09 09:34:29 adamdunkels Exp $ */ /** @@ -53,6 +53,17 @@ clock_time(void) return tv.tv_sec * 1000 + tv.tv_usec / 1000; } /*---------------------------------------------------------------------------*/ +unsigned long +clock_seconds(void) +{ + struct timeval tv; + struct timezone tz; + + gettimeofday(&tv, &tz); + + return tv.tv_sec; +} +/*---------------------------------------------------------------------------*/ void clock_delay(unsigned int d) {