由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - accurate C++ timer
相关主题
[合集] 又被羞辱了一把... (转载)How to tell if two computers are accurately synchronized?
Boost C++ Libraries, 大家看哪些部分? (转载)如何实现微秒精度的time stamp
C++ timer class for multithreads?web page programming 问题
[bssd] Yann LeCun stepped down问个关于socket问题
How to count how much time used for a programpython help ( probability distribution )
如何测试程序的execution time vs memory stall time (ratio)请教一下,怎么控制发送UDP的速度?
timer(linux/g++)?[合集] 急问: Visual Basic Timer Problem
How to set a timer in C?[合集] 请问这个process and timer的问题怎么实现?
相关话题的讨论汇总
话题: accurate话题: c++话题: timer话题: cpu话题: linux
进入Programming版参与讨论
1 (共1页)
i*****s
发帖数: 438
1
Anyone knows how to make an accurate C++ timer,
one that is accurate and not susceptible to
multi-core and CPU stepping, etc.? Thanks!
x*********h
发帖数: 25
2
Absolutely accurate c++ timer cannot be got at windows and linux.
In windows, try to use queryperformance*()
sorry, I cannot remember exact function name.
i*****s
发帖数: 438
3

Then what is the most accurate method under Linux?
With the rdtsc instruction, we can get cycles, but
it's not working with CPU stepping.
How is gettimeofday() implemented?

【在 x*********h 的大作中提到】
: Absolutely accurate c++ timer cannot be got at windows and linux.
: In windows, try to use queryperformance*()
: sorry, I cannot remember exact function name.

p***o
发帖数: 1252
4
getrusage?

【在 i*****s 的大作中提到】
:
: Then what is the most accurate method under Linux?
: With the rdtsc instruction, we can get cycles, but
: it's not working with CPU stepping.
: How is gettimeofday() implemented?

x*********h
发帖数: 25
d****2
发帖数: 6250
6
You can also use PAPI, using PAPI_get_real_usec. Though under linux it
requires kernel patch.
1 (共1页)
进入Programming版参与讨论
相关主题
[合集] 请问这个process and timer的问题怎么实现?How to count how much time used for a program
Java如何实现自动消失的消息框? (转载)如何测试程序的execution time vs memory stall time (ratio)
请教一个linux下的POSIX timer的问题。timer(linux/g++)?
python中的round命令怎么不管用了?How to set a timer in C?
[合集] 又被羞辱了一把... (转载)How to tell if two computers are accurately synchronized?
Boost C++ Libraries, 大家看哪些部分? (转载)如何实现微秒精度的time stamp
C++ timer class for multithreads?web page programming 问题
[bssd] Yann LeCun stepped down问个关于socket问题
相关话题的讨论汇总
话题: accurate话题: c++话题: timer话题: cpu话题: linux