gettimeofday() -- 获取当前时间(保存在结构体timeval中)【转】
来源:互联网 发布:js求log以10为底 编辑:程序博客网 时间:2024/06/05 16:51
#include <stdio.h>
#include <sys/time.h>
#include <time.h>
int main(int argc, char * argv[]){
}
(1) struct--timeval
--------------------------------------------------
struct timeval {
millisecond
microsecond
timeval表示一个时间点,比如:
timeval.tv_sec = 1
timevat.tv_usec = 500 000 (μs)
1:500 = 1s500000μs = 1.5s
(2) gettimeofday()
--------------------------------------------------
int gettimeofday(struct timeval *tv, structtimezone *tz);
(3) 运行结果:
--------------------------------------------------
time 1181788367:991487
time 1181788369:991602
表示睡眠2秒经过的精确时间为: 2s115μs
- gettimeofday() -- 获取当前时间(保存在结构体timeval中)
- gettimeofday() -- 获取当前时间(保存在结构体timeval中)
- gettimeofday() -- 获取当前时间(保存在结构体timeval中)
- gettimeofday() -- 获取当前时间(保存在结构体timeval中)【转】
- gettimeofday() -- 获取当前时间
- gettimeofday() -- 获取当前时间
- struct timeval结构体 以及 gettimeofday()函数
- struct timeval结构体 以及 gettimeofday()函数
- struct timeval结构体 以及 gettimeofday()函数
- struct timeval结构体 以及 gettimeofday()函数
- struct timeval结构体 以及 gettimeofday()函数
- struct timeval结构体 以及 gettimeofday()函数
- struct timeval结构体 以及 gettimeofday()函数
- struct timeval结构体 以及 gettimeofday()函数
- struct timeval结构体 以及 gettimeofday()函数
- struct timeval结构体 以及 gettimeofday()函数
- struct timeval结构体 以及 gettimeofday()函数
- struct timeval结构体 以及 gettimeofday()函数
- VMware下 Ubuntu 看不到共享文件夹之解决办法
- jstl fn函数总结
- China Job Hunter TV Show Takes Mean Spiritedness To New Level
- xampp无法启动apache,提示terminating worker thread 0
- Eclipse开发环境的一些设置
- gettimeofday() -- 获取当前时间(保存在结构体timeval中)【转】
- 快速排序实例
- window.ope()时刷新父页面的js代码
- Tkinter教程之Scrollbar篇
- Visual Studio 卸载方法
- AutoInvoice运行报错:You must supply an invoice number when your batch source indicates manual invoice nu
- 分享
- General helper class
- flex 两个GridColumnItemRenderer传值