c++ - Get date/time of last reboot programmatically -


i find time of last reboot programmatically in linux. using c , c++ in module.

is there api?

there's no direct api, can read /proc/uptime "file" learn how many seconds system have been running, subtract current time - , assume that's when machine rebooted.

/proc/uptime file contains 2 numbers: uptime of system (seconds), , amount of time spent in idle process (seconds).


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -