CC++毫秒时间戳函数

xiaoxiao2021-02-28  81

下面是产生毫秒时间戳的代码和测试案例

#include <stdio.h> #include <sys/timeb.h> #include <sys/types.h> long long getSystemTime() { struct timeb t; ftime(&t); return 1000*t.time + t.millitm; } int main() { long long start = getSystemTime(); printf("start = %lld\n",start); return 0; }
转载请注明原文地址: https://www.6miu.com/read-53779.html

最新回复(0)