代码拉取完成,页面将自动刷新
#include <assert.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/time.h>
// 1秒等于1000毫秒,等于1000000微秒
int main()
{
float time_use = 0;
struct timeval start;
struct timeval end;
gettimeofday(&start, NULL);
printf("start.tv_sec:%ld\n", start.tv_sec);
printf("start.tv_usec:%ld\n", start.tv_usec);
gettimeofday(&end, NULL);
time_use = (end.tv_sec - start.tv_sec) * 1000000 + (end.tv_usec - start.tv_usec);//微秒
printf("time_use is %f us \n", time_use);
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。