Added clock_seconds() implementation.

This commit is contained in:
oliverschmidt 2008-07-12 14:44:37 +00:00
parent 2b68f88e77
commit f822ac9797
2 changed files with 16 additions and 4 deletions

View file

@ -30,14 +30,14 @@
* *
* Author: Oliver Schmidt <ol.sc@web.de> * Author: Oliver Schmidt <ol.sc@web.de>
* *
* $Id: clock.c,v 1.1 2007/12/15 00:14:19 oliverschmidt Exp $ * $Id: clock.c,v 1.2 2008/07/12 14:44:37 oliverschmidt Exp $
*/ */
#include <time.h> #include <time.h>
#include "contiki.h" #include "contiki.h"
/*-----------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
clock_time_t clock_time_t
clock_time(void) clock_time(void)
{ {
@ -53,4 +53,10 @@ clock_time(void)
* on the educated guess of CLK_TCK being an even value. */ * on the educated guess of CLK_TCK being an even value. */
return clock() / (CLK_TCK / CLOCK_CONF_SECOND); return clock() / (CLK_TCK / CLOCK_CONF_SECOND);
} }
/*-----------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
unsigned long
clock_seconds(void)
{
return clock() / CLK_TCK;
}
/*---------------------------------------------------------------------------*/

View file

@ -30,7 +30,7 @@
* *
* Author: Oliver Schmidt <ol.sc@web.de> * Author: Oliver Schmidt <ol.sc@web.de>
* *
* $Id: clock.c,v 1.2 2007/12/16 13:11:46 oliverschmidt Exp $ * $Id: clock.c,v 1.3 2008/07/12 14:46:03 oliverschmidt Exp $
*/ */
#include <apple2.h> #include <apple2.h>
@ -76,3 +76,9 @@ clock_time(void)
return time; return time;
} }
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
unsigned long
clock_seconds(void)
{
return time / CLOCK_CONF_SECOND;
}
/*-----------------------------------------------------------------------------------*/