Copyright ©

Mongoose OS Forum


if statement trouble when Sys.uptime() comparing

tosqotosqo PL
edited March 2017 in Mongoose OS


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);
    print("False", time, time2);

And the output for this is:

False 0 0


Sign In or Register to comment.