Welcome![Sign In][Sign Up]
Location:
Search - QueryPerformanceCounter

Search list

[WEB CodeCPU 测速(MHz)和高精度延时(微秒级)

Description: 一.高精度延时, 是 CPU 测速的基础 Windows 内部有一个精度非常高的定时器, 精度在微秒级, 但不同的系统这个定时器的频率不同, 这个频率与硬件和操作系统都可能有关。 利用 API 函数 QueryPerformanceFrequency 可以得到这个定时器的频率。 利用 API 函数 QueryPerformanceCounter 可以得到定时器的当前值。 根据要延时的时间和定时器的频率, 可以算出要延时的时间定时器经过的周期数。 在循环里用 QueryPerformanceCounter 不停的读出定时器值, 一直到经过了指定周期数再结束循环, 就达到了高精度延时的目的。 高精度延时的程序, 参数: 微秒 二.测速程序 利用 rdtsc 汇编指令可以得到 CPU 内部定时器的值, 每经过一个 CPU 周期, 这个定时器就加一。 如果在一段时间内数得 CPU 的周期数, CPU工作频率 = 周期数 / 时间 为了不让其他进程和线程打扰, 必需要设置最高的优先级 以下函数设置当前进程和线程到最高的优先级。 SetPriorityClass(GetCurrentProcess(), REALTIME_PRIORITY_CLASS) SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL) CPU 测速程序的源代码, 这个程序通过 CPU 在 1/16 秒的时间内经过的周期数计算出工作频率, 单位 MHz: -one. High-precision delay, the CPU speed is the basis of Windows within a very high accuracy of the timer, the microsecond precision, but in the system timer different frequencies, the frequency and hardware and the operating system are likely. Using API function can be QueryPerformanceFrequency the timing The frequency. Use QueryPerformanceCounter API function can be the current timer value. According to the delay time and the frequency of the timer, you could calculate the time to delay timer after a few cycles. The circle with QueryPerformanceCounter repeatedly read out the timer value, until after a specified number of cycles end the cycle again, it reached a high precision delay purposes. High-precision delay the procedure parameters : 2 microsecond. Gun utilize RDTSC instruction can
Platform: | Size: 1213 | Author: 马俊 | Hits:

[CSharpC(3)

Description: C计时程序源代码 void mytime1() { static LARGE_INTEGER startTime QueryPerformanceCounter(&startTime) static LARGE_INTEGER timerFrequency -time C source code void mytime1 () (static LARGE_INTEGER startTime QueryPerformanceCounter (
Platform: | Size: 5374 | Author: 奕竹 | Hits:

[CSharpCjishitime

Description: C计时程序源代码 void mytime1() { static LARGE_INTEGER startTime QueryPerformanceCounter(&startTime) static LARGE_INTEGER timerFrequency QueryPerformanceFrequency(&timerFrequency) /////////////***你要计时的程序-time C source code void mytime1 () (static LARGE_INTEGER startTime QueryPerformanceCounter (
Platform: | Size: 963 | Author: 奕竹 | Hits:

[OpenGL program2D_curve

Description: 2D的贝塞尔曲线几种画法(2D_curve). 用到QueryPerformanceCounter及QueryPerformanceFrequency的帧速计数.-2D Bezier curves of several paintings (2D_curve). Use QueryPerfor manceCounter frame and QueryPerformanceFrequency speed counts.
Platform: | Size: 63814 | Author: 金哥 | Hits:

[Windows DevelopQueryPerformanceCounter_timer

Description: 精确到1us的定时器。使用QueryPerformanceCounter()函数实现 适用于实时控制环境-accurate to the timer. Use QueryPerformanceCounter () functions applicable to real-time control environment
Platform: | Size: 24335 | Author: 李新 | Hits:

[Process-Threadbootstrap

Description: 这个频率与硬件和操作系统都可能有关。利用 API 函数 QueryPerformanceFrequency 可以得到 这个定时器的频率。利用 API 函数 QueryPerformanceCounter 可以得到定时器的当前值。根据 要延时的时间和定时器的频率, 可以算出要延时的时间定时器经过的周期数。在循环里用 QueryPerformanceCounter 不停的读出定时器值, 一直到经过了指定周期数再结束循环, 就达到-the frequency with hardware and the operating system are likely. Using API function can be QueryPerformanceFrequency the timing The frequency. QueryPerformanceCounter API function can be present timer value. According to the delay time and the frequency of the timer, you could calculate the time to delay timer after a few cycles. In the circle with QueryPerformanceCounter kept read timer value, until after a specified number of cycles end the cycle again, to achieve
Platform: | Size: 238447 | Author: xianhao | Hits:

[Other resourcePLC_Control

Description: 欧姆龙最新PLC CPH1系列hostlink应用例子,用于编写上位机控制软件,通过串口直接控制PLC。用vc编写,方便转化为其他语言。 包括内容: 1:自封装串口类(来源于网络,做了适当修改) 2:多线程,线程间同步,通讯等。 3:生产者消费者模型应用,环形缓冲队列应用 4:欧姆龙hostlink通讯通讯同步处理,FCS校验值计算,各种hostlink指令使用示例。 5:线程消息处理类封装。 6:windows程序中带console调试界面,可把调试信息输出到控制台窗口及文件。 7:windows界面调试工具。(win32多线程程序设计一书中WM_COPYDATA例子封装,运行程序前启动目录中CopyRecv程序。) 8:自封装高精度计时器。(QueryPerformanceFrequency,QueryPerformanceCounter) 9:其他详见代码,此测试程序对初学者非常有帮助,而请大虾多指教。 e-mail:m__point@163.com -OMRON PLC CPH1 latest series hostlink application examples, for the preparation of PC control software through direct serial control PLC. Prepared using vc facilitate conversion to other languages. Including : 1 : Since Packaging serial category (from the network, so the appropriate modifications) 2 : multiple threads, thread synchronization, communications. 3 : Producer consumer model, a circular buffer queue application 4 : OMRON hostlink synchronous communications Communications, FCS checksum calculation, hostlink various examples of the use of directives. 5 : threaded message processing category Packaging. 6 : windows proceedings with console debugging interface Debugging information can be output to the console window and documents. 7 : windows interface debugging tools. (Win32 multit
Platform: | Size: 72165 | Author: m__point | Hits:

[WinSock-NDISTimer

Description: 可以通过各种不同的函数来获取时间,且时间精度各不相同如使用QueryPerformanceFrequency()和QueryPerformanceCounter()来进行高精度定时
Platform: | Size: 37383 | Author: 聂山权 | Hits:

[OS programDelay_time

Description: 用C编写的微秒级精确延时DLL函数库,通过调用kernel32.dll的QueryPerformanceFrequency()、QueryPerformanceCounter()函数实现。
Platform: | Size: 94636 | Author: 王学文 | Hits:

[DocumentsCPU 测速(MHz)和高精度延时(微秒级)

Description: 一.高精度延时, 是 CPU 测速的基础 Windows 内部有一个精度非常高的定时器, 精度在微秒级, 但不同的系统这个定时器的频率不同, 这个频率与硬件和操作系统都可能有关。 利用 API 函数 QueryPerformanceFrequency 可以得到这个定时器的频率。 利用 API 函数 QueryPerformanceCounter 可以得到定时器的当前值。 根据要延时的时间和定时器的频率, 可以算出要延时的时间定时器经过的周期数。 在循环里用 QueryPerformanceCounter 不停的读出定时器值, 一直到经过了指定周期数再结束循环, 就达到了高精度延时的目的。 高精度延时的程序, 参数: 微秒 二.测速程序 利用 rdtsc 汇编指令可以得到 CPU 内部定时器的值, 每经过一个 CPU 周期, 这个定时器就加一。 如果在一段时间内数得 CPU 的周期数, CPU工作频率 = 周期数 / 时间 为了不让其他进程和线程打扰, 必需要设置最高的优先级 以下函数设置当前进程和线程到最高的优先级。 SetPriorityClass(GetCurrentProcess(), REALTIME_PRIORITY_CLASS) SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL) CPU 测速程序的源代码, 这个程序通过 CPU 在 1/16 秒的时间内经过的周期数计算出工作频率, 单位 MHz: -one. High-precision delay, the CPU speed is the basis of Windows within a very high accuracy of the timer, the microsecond precision, but in the system timer different frequencies, the frequency and hardware and the operating system are likely. Using API function can be QueryPerformanceFrequency the timing The frequency. Use QueryPerformanceCounter API function can be the current timer value. According to the delay time and the frequency of the timer, you could calculate the time to delay timer after a few cycles. The circle with QueryPerformanceCounter repeatedly read out the timer value, until after a specified number of cycles end the cycle again, it reached a high precision delay purposes. High-precision delay the procedure parameters : 2 microsecond. Gun utilize RDTSC instruction can
Platform: | Size: 1024 | Author: 马俊 | Hits:

[CSharpC(3)

Description: C计时程序源代码 void mytime1() { static LARGE_INTEGER startTime QueryPerformanceCounter(&startTime) static LARGE_INTEGER timerFrequency -time C source code void mytime1 () (static LARGE_INTEGER startTime QueryPerformanceCounter (
Platform: | Size: 5120 | Author: 奕竹 | Hits:

[CSharpCjishitime

Description:
Platform: | Size: 1024 | Author: 奕竹 | Hits:

[Windows DevelopMinTimer

Description: 毫秒定时器,为什么要使用毫秒定时器呢?我想原因有两个。第一:CWnd里面的timer不能精确到毫秒级,所以必须要写一个精确到毫秒级的。第二:用CWnd里面的timer代价太大,因为有时我们的类根本就没有窗口,为了使用timer,而不得不从CWnd里派生。本人写的这个mmtimer,主要是为了解决上面这两点而设计的-millisecond timer, why should the use of millisecond timer? I think there are two reasons. First : CWnd not inside the timer accurate to the millisecond, we must write an accurate to the millisecond. Second : CWnd timer inside the price is too high, because sometimes we simply do not like the window, In order to use the timer, which had derived from CWnd Lane. I wrote this mmtimer, is mainly to solve the above two points and design
Platform: | Size: 112640 | Author: zniao | Hits:

[OpenGL program2D_curve

Description: 2D的贝塞尔曲线几种画法(2D_curve). 用到QueryPerformanceCounter及QueryPerformanceFrequency的帧速计数.-2D Bezier curves of several paintings (2D_curve). Use QueryPerfor manceCounter frame and QueryPerformanceFrequency speed counts.
Platform: | Size: 63488 | Author: 金哥 | Hits:

[Windows DevelopQueryPerformanceCounter_timer

Description: 精确到1us的定时器。使用QueryPerformanceCounter()函数实现 适用于实时控制环境-accurate to the timer. Use QueryPerformanceCounter () functions applicable to real-time control environment
Platform: | Size: 24576 | Author: 李新 | Hits:

[Process-Threadbootstrap

Description: 这个频率与硬件和操作系统都可能有关。利用 API 函数 QueryPerformanceFrequency 可以得到 这个定时器的频率。利用 API 函数 QueryPerformanceCounter 可以得到定时器的当前值。根据 要延时的时间和定时器的频率, 可以算出要延时的时间定时器经过的周期数。在循环里用 QueryPerformanceCounter 不停的读出定时器值, 一直到经过了指定周期数再结束循环, 就达到-the frequency with hardware and the operating system are likely. Using API function can be QueryPerformanceFrequency the timing The frequency. QueryPerformanceCounter API function can be present timer value. According to the delay time and the frequency of the timer, you could calculate the time to delay timer after a few cycles. In the circle with QueryPerformanceCounter kept read timer value, until after a specified number of cycles end the cycle again, to achieve
Platform: | Size: 238592 | Author: xianhao | Hits:

[Other systemsPLC_Control

Description: 欧姆龙最新PLC CPH1系列hostlink应用例子,用于编写上位机控制软件,通过串口直接控制PLC。用vc编写,方便转化为其他语言。 包括内容: 1:自封装串口类(来源于网络,做了适当修改) 2:多线程,线程间同步,通讯等。 3:生产者消费者模型应用,环形缓冲队列应用 4:欧姆龙hostlink通讯通讯同步处理,FCS校验值计算,各种hostlink指令使用示例。 5:线程消息处理类封装。 6:windows程序中带console调试界面,可把调试信息输出到控制台窗口及文件。 7:windows界面调试工具。(win32多线程程序设计一书中WM_COPYDATA例子封装,运行程序前启动目录中CopyRecv程序。) 8:自封装高精度计时器。(QueryPerformanceFrequency,QueryPerformanceCounter) 9:其他详见代码,此测试程序对初学者非常有帮助,而请大虾多指教。 e-mail:m__point@163.com -OMRON PLC CPH1 latest series hostlink application examples, for the preparation of PC control software through direct serial control PLC. Prepared using vc facilitate conversion to other languages. Including : 1 : Since Packaging serial category (from the network, so the appropriate modifications) 2 : multiple threads, thread synchronization, communications. 3 : Producer consumer model, a circular buffer queue application 4 : OMRON hostlink synchronous communications Communications, FCS checksum calculation, hostlink various examples of the use of directives. 5 : threaded message processing category Packaging. 6 : windows proceedings with console debugging interface Debugging information can be output to the console window and documents. 7 : windows interface debugging tools. (Win32 multit
Platform: | Size: 71680 | Author: | Hits:

[Internet-NetworkTimer

Description: 可以通过各种不同的函数来获取时间,且时间精度各不相同如使用QueryPerformanceFrequency()和QueryPerformanceCounter()来进行高精度定时-Through a variety of functions to obtain time and time accuracy, such as the use of different QueryPerformanceFrequency () and QueryPerformanceCounter () to carry out high-precision timing
Platform: | Size: 36864 | Author: 聂山权 | Hits:

[OS programDelay_time

Description: 用C编写的微秒级精确延时DLL函数库,通过调用kernel32.dll的QueryPerformanceFrequency()、QueryPerformanceCounter()函数实现。-Prepared with C-level precision microsecond delay DLL function library, by calling the kernel32.dll of QueryPerformanceFrequency (), QueryPerformanceCounter () function.
Platform: | Size: 94208 | Author: 王学文 | Hits:

[OthermTimer

Description: 用VC++编程,比较三种定时器——SetTimer、timeSetEvent、、QueryPerformanceCounter、GetTickCount的在精度上的差别-Using VC++ programming, comparing three types of timers- SetTimer, timeSetEvent,, QueryPerformanceCounter, GetTickCount the difference in accuracy
Platform: | Size: 731136 | Author: Edison | Hits:
« 12 »

CodeBus www.codebus.net