我想在Linux中以编程方式找到上次重启的时间.我在我的模块中使用C和C.
有API吗?
解决方法:
没有直接的api,但你可以读/ proc / uptime“file”来了解系统运行了多少秒,从当前时间减Go – 并假设机器重启时.
/proc/uptime
This file contains two numbers: the uptime of the system
(seconds), and the amount of time
spent in idle process (seconds).