opencv 3.0 windows 计时函数 timer
来源:互联网 发布:linux search命令 编辑:程序博客网 时间:2024/05/16 11:24
计时函数
1. 纯C 高精度(100ns)测量慢
#include <Windows.h>#include <stdio.h>int timer1_test(){ LARGE_INTEGER start; LARGE_INTEGER end ; LARGE_INTEGER frequency; int i = 0; if (!QueryPerformanceFrequency(&frequency)) { return -1; } QueryPerformanceCounter(&start); //开始计时// for (int i = 0; i < 100000; ++i)// {// ;// 用循环来测试计时// } Sleep(1); QueryPerformanceCounter(&end); //结束计时 printf("main cost:%f\n", (double)(end.QuadPart - start.QuadPart) / (double)frequency.QuadPart); //打印for循环执行时间 getchar(); return 0;}
2.纯C 低精度(1ms)测量快
#include <stdio.h>#include <time.h>void timer2_test(){ clock_t start,end; start=clock(); Sleep(1000); end=clock(); printf("The differences: %d ms\n",end-start);}
3.C++ OPENCV测试 高精度
#include"opencv.hpp"void timer3_test(){ int64 start=0,end=0; start = getTickCount(); Sleep(1000); end = getTickCount(); cout << "The differences: " << 1000.0*(end - start)/getTickFrequency()<<" ms"<< endl;}
0 0
- opencv 3.0 windows 计时函数 timer
- Windows精准计时&精准Timer
- opencv 计时函数
- Opencv计时函数
- Opencv计时函数
- opencv:计时函数
- opencv计时函数
- windows计时函数
- Linux & Windows 计时函数
- opencv 计时函数,以及方法
- Windows 各种计时函数总结
- Windows 各种计时函数总结
- Windows 各种计时函数总结
- Windows 各种计时函数总结
- Windows 各种计时函数总结
- Windows 各种计时函数总结
- Windows 各种计时函数总结
- Windows 各种计时函数总结
- Go Web服务开发入门(一) -- 搭建简单web服务器
- 筛选法构造素数表
- IOS从相册上传照片
- Q1.8 Check if s2 is a rotation of s1
- 快速搭建Web环境 Angularjs + Express3 + Bootstrap3
- opencv 3.0 windows 计时函数 timer
- STM32 学习十 Flash下载与调试
- Delphi 与 C/C++ 数据类型对照表(转)
- getline基本用途
- Android自定义音乐播放器
- Java泛型数组转换处理
- 排序算法
- [ASP.NET-V] SQL Server 2008数据库的备份与还原
- Effective C++ (笔记) : 条款11 -- 条款17