who -b 查看当前系统启动时间
last | grep reboot
last 查看系统关闭 启动日志
clock_gettime 获取计算机上电启动时长 clock_gettime(CLOCK_MONOTONIC, &time1);
{
__time_t tv_sec; /* Seconds. /
__syscall_s long_t tv_nsec; / Nanoseconds. */
};
who -b 查看当前系统启动时间
last | grep reboot
last 查看系统关闭 启动日志
clock_gettime 获取计算机上电启动时长 clock_gettime(CLOCK_MONOTONIC, &time1);
{
__time_t tv_sec; /* Seconds. /
__syscall_s long_t tv_nsec; / Nanoseconds. */
};