I know this was discussed recently, but I was not satisfied with the answer(s) given there. I did raise some issues there that were not very well answered (IMHO, of course). I am hoping for a better outcome here.
The question is: What's the best way to get the system uptime in WB?
Now, note that when people (and, in this case, "people" is me) ask about uptime, they are really asking 3 distinct, though related, questions:
1) When was the system (most recently) booted? (date/time)
2) How long ago was the system (most recently) booted? (duration)
3) How long has the system actually been up (i.e., functional) (since the most recent boot)?
Note that 1 & 2 are equivalent - meaning that, provided you know the current date/time, either can be calculated from the other. And, of course, 2 & 3 would be identical provided the system has never been suspended (hibernated, whatever).
So, given that they are all different concepts, what is the best way to get each/all of these values, in WB (using, presumably, DllCalls and/or WMI) ?