in reply to $BASETIME (^T) inaccurate?

Linux uptime accounts for changes in the system clock. That is: If you advance the clock 15minute, uptime advances its starting time by 15 minutes.

$^T is simply the value of the time when your program started, and time is value of time now. So if the clock has advanced, the difference between these values will advance. Basically: deltas in perl 'time' cannot be used to judge time elapsed. They can only tell you what system clock was a two points.

Replies are listed 'Best First'.
Re^2: $BASETIME (^T) inaccurate?
by bliako (Abbot) on Apr 13, 2023 at 09:32 UTC
    If you advance the clock 15minute, uptime advances its starting time by 15 minutes.

    and what happens if you "retard" the system clock? Perhaps you are confusing the first column in uptime's output (which is the current clock time) with the second column which is HH::MM of uptime? (Thank you Anonymous Re^2: $BASETIME (^T) inaccurate? for pointing this)

Re^2: $BASETIME (^T) inaccurate?
by Anonymous Monk on Apr 12, 2023 at 13:18 UTC
    If you advance the clock 15minute, uptime advances its starting time by 15 minutes.

    I dont think thats technically accurate, its just what it looks like. probably just uses a monotonic clock