📄 get_time.c
字号:
#include <stdio.h>#include <sys/sysinfo.h>#include <time.h>#define USE_UPTIME 1// When system time change, the lease table will error, so we use system uptimetime_t // long intget_time(time_t *t){#ifdef USE_UPTIME struct sysinfo info; sysinfo(&info); return info.uptime;#else return time(0);#endif}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -