Hi, I really hate to be somebody replying to this, esp. due to my inexperience, but since I've already (briefly) mentioned such in private email today, what's one more? ;-) So corrections heavily welcome.
1). I wouldn't use the PIT, sounds unreliable, but then again, I don't know how anyways. ;-) 2). Check DJGPP's sources for gettimeofday() or clock() or uclock() and see what it does. Probably just uses BIOS int 0x1A. 3). RDTSC (586+) is probably not what you want, esp. due to early 586-686 time duration limitations and later SMP having issues with different cores having different skewed timers ... but, they "may?" have fixed that in latest cpus to be more consistent (I'm not sure). Though this may be a bit less precise than the ultimate best way (which is ... ?? dunno). 4). ACPI / APM / power management can muck with this too. The Intel P4 can slow down on high heat levels, newer x86 can disable some cores, and also some support Turbo Boost, which means you can speed up single core (allegedly) if you enable P0 state. I've not tried, though. 5). RDPMC is a PPro instruction for reading "performance monitor counter(s)", and I blindly assume this is what Windows uses with their QueryPerformanceCounter(), though I expect you could find out specifically if you searched online in the right place. http://en.wikipedia.org/wiki/Turbo_Boost http://www.rcollins.org/p6/opcodes/RDPMC.html http://en.wikipedia.org/wiki/Time_Stamp_Counter http://www.delorie.com/bin/cvsweb.cgi/djgpp/src/libc/pc_hw/timer/uclock.c?rev=1.5 P.S. For some reason, I vaguely get the idea that the FreeBASIC (DOS sub)forum has something about this. Or maybe it's just their experience in weird arcane areas like this. So you could try asking them. http://www.freebasic.net/forum/ On Fri, Mar 23, 2012 at 4:57 PM, BretJ <[email protected]> wrote: > > Nanosecond resolution is a little tough, but microsecond is pretty easy just > using the PIT. Is microsecond good enough for your purposes? > -- > View this message in context: > http://old.nabble.com/hardware-timer-QueryPerformanceCounter-tp33536190p33544671.html > Sent from the FreeDOS - User mailing list archive at Nabble.com. ------------------------------------------------------------------------------ This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure _______________________________________________ Freedos-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/freedos-user
