This is great, but there are issues with QueryPerformanceCounter that I think ought to be pointed out if you aren't already aware of them. QPC is horribly unreliable on some chipsets and, on some systems, when running on multiple cores. Both issues are decribed in the MS Knowledge Base, with the chipset problem at [1] and the multicore problem at [2]. In the latter, pay particular attention to point #4 in the Recommendations section.
Starting with Vista, QPC will use the newer High Precision Event Timer [3], if available (which it should be for most systems running Vista or 7), so this becomes less of an issue. But for XP, which is still going to be relevant for a few more years at least, this is a big headache. You can read more about timing issues in the PDF at [4]. If I were going to use this class in a game, I would expect it to take the recommended precautions on XP. Otherwise, I'd just roll my own using timeGetTime. [1] http://support.microsoft.com/kb/274323 [2] http://msdn.microsoft.com/en-us/library/ee417693.aspx [3] http://en.wikipedia.org/wiki/High_Precision_Event_Timer [4] (direct PDF link) http://algo2.iti.kit.edu/wassenberg/timing/timing_pitfalls.pdf On Tue, Aug 17, 2010 at 7:43 PM, SHOO <zan77...@nifty.com> wrote: > I made the module of the stopwatch, so I suggest it again here. > > I suggested a time handling module that I called std.time before. > Unfortunately itself was not able to contribute to Phobos for the issue > of license. But, an important function was included in it. It is what is > the StopWatch suggested this time. > > I have some knowledge about machine control engineering. In the field of > the machine control engineering, the high accuracy time measurement > often plays an important role. > For example, the case wants to perform the measurement of the voltage > with time by millisecond order for feedback control. When it looks like > it, resolution power is not enough by time acquisition such as C's time > function in many cases. > > Or the high accuracy time measurement is important in the game > programming, too. Or in benchmark testing, too. > > There is std.perf in Phobos as a module with this role now. > However, the module is unlisted, and a license doesn't seem to be a > Boost license, too. > I did not refer Tango at all about this class and examined and made it > in my own hand completely. > > Here is the module to suggest this time: > http://ideone.com/TVw1P > > # This module is tested by Windows (real) and Ubuntu (virtual PC). > > Please look at it once by all means, and review it. > I think that I will commit it at 2010-08-22T15:00Z as far as there is > not serious dissenting opinion. > _______________________________________________ > phobos mailing list > phobos@puremagic.com > http://lists.puremagic.com/mailman/listinfo/phobos > -- Mike Parker
_______________________________________________ phobos mailing list phobos@puremagic.com http://lists.puremagic.com/mailman/listinfo/phobos