2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
5 Returns time passed since start of program.
8 #include <aros/symbolsets.h>
10 #include "__stdc_intbase.h"
12 /*****************************************************************************
23 clock() returns an approximation of the time passed since
24 the program was started
29 The time passed in CLOCKS_PER_SEC units. To get the
30 number of seconds divide by CLOCKS_PER_SEC.
33 Reference point is set when stdc.library is opened.
34 If you use the function from another shared library the reference
35 point is thus when this library opened stdc.library
46 ******************************************************************************/
48 struct StdCIntBase
*StdCBase
= (struct StdCIntBase
*)__aros_getbase_StdCBase();
50 return (clock_t)time(NULL
) - StdCBase
->starttime
;
53 int __init_clock(struct StdCIntBase
*StdCBase
)
55 StdCBase
->starttime
= (clock_t)time(NULL
);
60 ADD2OPENLIB(__init_clock
, 20);