Page 1 of 1

Weird milliseconds return in Service Running

Posted: 10 Dec 2016 16:02
by husky
Hello,

I noticed that the Service Running variable active_since returns milliseconds with 6 insted of 8 digits.

is that a correct time?
As per Supplied Variables description.

active_since
the time this service has been started in milliseconds since the device was booted

Obviously the right active_since can be calculated correclty even with 6 digits but then we are not dealing with milliseconds anymore, ergo, is the documentation faulty?

Oddly enough, if I wait for x minutes to run the same flow, the "millisecods" does not seem to get updated. It always shows the same time instead of the old time + x minutes.
I'm confused here.


Thanks

Husky

Re: Weird milliseconds return in Service Running

Posted: 10 Dec 2016 20:24
by Martin
Hi,

The time active_since indicates the moment when the service was started (in millis since the device was started), not how long the service is already running.
You can convert the time to a normal date/time with a script like this:
started = triggertime - getElapsedRealtimeMillis() + active_since;
duration = triggertime - started;

Regards,
Martin