2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
5 Returns time passed since start of program.
8 #include "__arosc_privdata.h"
11 #include <proto/dos.h>
12 #include <aros/symbolsets.h>
14 /*****************************************************************************
25 clock() returns an approximation of the time passed since
26 the program was started
31 The time passed in CLOCKS_PER_SEC units. To get the
32 number of seconds divide by CLOCKS_PER_SEC.
35 This function must not be used in a shared library or
36 in a threaded application.
47 ******************************************************************************/
52 DateStamp (&t
); /* Get timestamp */
55 retval
= (t
.ds_Days
- __startup_datestamp
.ds_Days
);
57 /* Convert into minutes */
60 /* Minute difference */
61 retval
+= (t
.ds_Minute
- __startup_datestamp
.ds_Minute
);
63 /* Convert into CLOCKS_PER_SEC (which is the same as TICKS_PER_SECOND) units */
64 retval
*= (60 * TICKS_PER_SECOND
);
66 /* Add tick difference */
67 retval
+= (t
.ds_Tick
- __startup_datestamp
.ds_Tick
);
73 int __init_clock(void)
75 DateStamp(&__startup_datestamp
);
79 ADD2INIT(__init_clock
, 20);