时间编程--gettimeofday(获取高精度时间)

#include 
#include 

/**********************
*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;
}

你可能感兴趣的:(LINUX)