#include <stdio.h>
#include <sys/time.h>
/**********************
*name:gettimeofday.c
*author:QG
*time:2015-05-13
*description:
***********************/
int main()
{
//struct timeval *tv;
struct timeval tv;
int ret;
ret = gettimeofday(&tv,NULL);
//if(ret == 0)
//{
printf("get the gettimeofday :seconds: %d,microseconds :%d\n",tv.tv_sec,tv.tv_usec);
//}
return 0;
}
时间编程--gettimeofday(获取高精度时间)
最新推荐文章于 2025-10-24 17:47:39 发布
本文提供了一个简单的C语言程序示例,该程序使用gettimeofday函数来获取当前系统的秒数和微秒数,并将这些信息打印到控制台。
5146

被折叠的 条评论
为什么被折叠?



