It depends on the system you are talking about. For Linux-based systems, you probably are using `uptime` from `procps`, which reads the data from `/proc/uptime`.
To see this, read the source-code in its Git repository, e.g., uptime.c, which uses proc/sysinfo.c.
According to CentOS documents
> 3.2.30. /proc/uptime
>
> This file contains information detailing how long the system has been on since its last restart. The output of /proc/uptime is quite minimal:
>
> `350735.47 234388.90`
>
> The first number is the total number of seconds the system has been up. The second number is how much of that time the machine has spent idle, in seconds.
But the source-code in `uptime.c` ignores the _idle_ value. Because the system is _powered on_ , I would expect it to reflect the elapsed time.