Gets System Up Time. (version 4.81 or later)

uptime <intvar>


Retrieves the number of milliseconds that have elapsed since the Windows OS was started, and then stores the value into the <intvar> variable.

The time wraps around to zero if the system is run continuously for 49.7 days.


; How to get the uptime in Windows
uptime var
day = var / 86400000
var = var % 86400000
hour = var / 3600000
var = var % 3600000
min = var / 60000
var = var % 60000
sec = var / 1000

sprintf2 str "System Up Time: %d Days, %d Hours, %d Minutes, %d Seconds" day hour min sec
messagebox str "uptime"
uptime varstart

; do something...

uptime varend
diff = varend - varstart
sprintf2 str "MACRO running time: %d msec" diff
messagebox str "running time"