2 Copyright © 1995-2018, The AROS Development Team. All rights reserved.
5 Desc: GetUpTime() - Get time since machine was powered on.
9 #include <proto/exec.h>
11 #include "timer_intern.h"
13 /*****************************************************************************
16 #include <devices/timer.h>
17 #include <proto/timer.h>
19 AROS_LH1(void, GetUpTime
,
22 AROS_LHA(struct timeval
*, dest
, A0
),
25 struct Device
*, TimerBase
, 12, Timer
)
28 GetUpTime() will fill in the supplied timeval with the current
32 dest - A pointer to the timeval you want the time stored in.
35 The timeval "dest" will be filled with the current uptime. This timer
36 cannot be changed by the software and thus can be considered to be a
40 This function is safe to call from interrupts.
47 TR_GETSYSTIME, TR_SETSYSTIME, GetSysTime
52 05-08-2018 schulz Implemented.
54 *****************************************************************************/
60 /* Query the hardware */
61 EClockUpdate(GetTimerBase(TimerBase
));
62 dest
->tv_secs
= GetTimerBase(TimerBase
)->tb_Elapsed
.tv_secs
;
63 dest
->tv_micro
= GetTimerBase(TimerBase
)->tb_Elapsed
.tv_micro
;