Topic : The ATARI Compendium
Author : Scott Sanders / JAY Software
Version : 1.25 (20/6/2003)
Subject : Documentation
Nodes : 1117
Index Size : 32614
HCP-Version : 6
Compiled on : Atari
@charset : UTF-8
@lang : en
@default :
@help : %About
@options : +g -i -t4 +y +z
@width : 100
View Ref-FileSuptime() GEMDOSSyntaxLONG Suptime( uptime, loadaverage )
LONG *uptime;
LONG *loadaverage;
Function Suptime() returns the current uptime and load averages from
the system.
Opcode 319 (0x013f)
Availability Available when a 'MiNT' cookie with a version of at least
1.11 exists.
Parametres uptime is a pointer to a LONG value that will be filled
with the current amount of seconds elapsed since last
reboot.
loadaverage is a pointer to a three longword array, that
will be filled with the current load averages (for last 1,
5 and 15 minutes).
Binding pea loadaverage
pea uptime
move.w #$013f,-(sp)
trap #1
lea $0a(sp),sp
Return Value Suptime() returns E_OK or a negative GEMDOS error code
otherwise (actually it may be only EINVFN if the call is
not supported...).
Comments The load average value is calculated using the following
formula:
sum += (new_load - old_load) * LOAD_SCALE;
load_avg = sum / MAX_SIZE;
where LOAD_SCALE is 2048, MAX_SIZE is 12 for 1 min., 60 for
5 min. and 180 for 15 min. new_load is the number of
currently running processes, old_load is the number of
processes running previous time.