請問C++中獲取時間的函數是什么?精度需要到毫秒的﹗
謝謝﹗
謝謝﹗
解决方案 »
- 重载OnSysCommand,实现点击叉叉,窗口最小化
- 求救:VC读取outlook地址薄 去掉警告对话框的解决办法。
- VC2005下制作打包文件,如何将安装路径写入注册表?
- 水园暗杀联盟招兵买马中。。。。。。。。。。。。。
- 关于标题栏消息wm_nc的问题
- 孙鑫的VC视频要在哪里下啊?我这里是校园网,用不了电驴啊。。。。哪位大侠能指点一下啊?。。。。雪地裸体跪谢
- 我装了Visual Assist 后,Ctrl + Space就不能用了?
- 推荐一些native API的资料~~~!!!
- vc.net能兼容VC6.0的代码吗?它们之间有什么主要区别?(在线等!)
- 微软专家:重贴CreateToolhelp32Snapshot的问题。
- 新手问题
- 关于LIB文件
The number of milliseconds that have elapsed since the system was started indicates success
Parameters
lpSystemTime
[out] Pointer to a SYSTEMTIME structure to receive the current system date and time.
Return Values
None.
FILETIME * lpFileTime //Pointer to return the structure
);The FILETIME data structure is a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601.
#include <windows.h>
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
LARGE_INTEGER t1,t2,feq;
int b=0;
QueryPerformanceFrequency(&feq);//每秒跳动次数
QueryPerformanceCounter(&t1);//测前跳动次数
for(int i=0;i<100;i++) b++;
QueryPerformanceCounter(&t2);//测后跳动次数
double d=((double)t2.QuadPart-(double)t1.QuadPart)/((double)feq.QuadPart);//时间差秒
std::cout<<setprecision(20)<<showpoint<<std::endl;//小数点表示20位*e-6,已换算为秒
std::cout<<d<<std::endl;
return 0;
}