[C]gettimeofday()

2016-2-2 写技术

#include <stdio.h>
#include <sys/time.h>
#include <string.h>

void test_gettimeofday(){
        struct timeval tv;
        struct timezone tz;
        gettimeofday(&tv, &tz);
        printf("tv.tv_sec = %d , tv.tv_usec = %d \n", tv.tv_sec, tv.tv_usec);
        printf("tz.tz_minuteswest = %d , tz.tz_dsttime = %d \n", tz.tz_minuteswest, tz.tz_dsttime);
}

标签: C

发表评论:

Powered by anycle 湘ICP备15001973号-1