Chinaunix首页 | 论坛 | 博客
  • 博客访问: 590661
  • 博文数量: 150
  • 博客积分: 1132
  • 博客等级: 少尉
  • 技术积分: 2067
  • 用 户 组: 普通用户
  • 注册时间: 2012-04-11 16:46
文章分类

全部博文(150)

文章存档

2015年(15)

2014年(75)

2013年(4)

2012年(56)

分类: LINUX

2014-10-28 20:52:36

1. time:
系统调用
功能:返回从 1970-01-01 00:00:00 到此刻秒数。
#include
time_t time(time_t *t);
2. gettimeofday:
系统调用
功能:返回从 1970-01-01 00:00:00 到此刻秒数和毫秒数(比 time 返回的时间更精准)。
#include
int gettimeofday(struct timeval *tv, struct timezone *tz);

struct timeval {
    time_t tv_sec;    /*seconds*/
    suseconds_t tv_usec;  /*microseconds*/
};
阅读(651) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~