Added clock_seconds() implementation.
This commit is contained in:
parent
2b68f88e77
commit
f822ac9797
2 changed files with 16 additions and 4 deletions
|
@ -30,14 +30,14 @@
|
|||
*
|
||||
* 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 "contiki.h"
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/*---------------------------------------------------------------------------*/
|
||||
clock_time_t
|
||||
clock_time(void)
|
||||
{
|
||||
|
@ -53,4 +53,10 @@ clock_time(void)
|
|||
* on the educated guess of CLK_TCK being an even value. */
|
||||
return clock() / (CLK_TCK / CLOCK_CONF_SECOND);
|
||||
}
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/*---------------------------------------------------------------------------*/
|
||||
unsigned long
|
||||
clock_seconds(void)
|
||||
{
|
||||
return clock() / CLK_TCK;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
*
|
||||
* 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>
|
||||
|
@ -76,3 +76,9 @@ clock_time(void)
|
|||
return time;
|
||||
}
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
unsigned long
|
||||
clock_seconds(void)
|
||||
{
|
||||
return time / CLOCK_CONF_SECOND;
|
||||
}
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
|
Loading…
Reference in a new issue