(And if you don't have a scope or freq. meter) a suitably programmed Arduino or similar microcontroller could do this fairly easily for you - probably with better than 0.01% precision.
Regards, Martin martinvisse...@gmail.com On Wed, May 26, 2010 at 10:53 AM, Dion <tenz...@iinet.net.au> wrote: > Martin, > > That is a very good idea. Thank you! > > What makes this especially helpful and I'm anoyed I didn't think of it > myself, is that an empty app or loop with only the output pulse included, > can be used to approximate the overhead of the rest of the system. > Effectively giving a potentially more precise measure of the speed of my > actual code. > > Cheers. > Dion. > > > > On 25/05/10 3:11 PM, Martin Visser wrote: > >> Dion, >> >> As a soon-to-graduate EE you might consider using a tool such as >> oscilloscope or frequency counter to help more objectively measure timing. A >> simple thing to do would be to have your code section run in a repeating >> loop. At the end of the loop toggle a physical output - say the DTR line on >> a serial port, or even the Num Lock LED on you keyboard. Connection up your >> 'scope or meter to that physical interface and measure the frequency. I'm >> pretty sure these modern time-domain measuring devices are going to have >> some nice crystal-locked output that should have better than 0.1% or better >> resolution. Just compare that to your output from time() and see how you go. >> >> Regards, Martin >> >> martinvisse...@gmail.com <mailto:martinvisse...@gmail.com> >> > > -- > "Never ascribe to malice that which may adequately be explained by > incompetence." - Napoleon Bonaparte > > > -- > "Never ascribe to malice that which may adequately be explained by > incompetence." - Napoleon Bonaparte > > -- > SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ > Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html > -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html