Copyright © https://mongoose-os.com

Mongoose OS Forum

frame

if statement trouble when Sys.uptime() comparing

tosqotosqo PL
edited March 17 in Mongoose OS

Hi

I have some problem with the simplest thing. I have this code:
i use this:

**Sys.uptime()** - return number of seconds since last reboot.
uptime: ffi('double mg_time()')

so i think that is should return a double integer but, I have this code:

let time = Sys.uptime();
let time2 = Sys.uptime();
if(time === time2){
    print("True", time, time2);
}
else{
    print("False", time, time2);
}

And the output for this is:

False 0 0

Comments

Sign In or Register to comment.