time-measurement

Python speed testing - Time Difference - milliseconds

What is the proper way to compare 2 times in Python in order to speed test a section of code? I tried reading the API docs. I'm not sure I understand the timedelta thing. So far I have this code: from datetime import datetime tstart = datetime.now() print t1 # code to speed test tend = datetime.now() print t2 # what am I missing? # ...

what is average case analysis?

Hello again guys, question 1: why is average case analysis more difficult to carry out than the worst case analysis. got to think of alteast 4 points, thought of 1, am i right? answer: Algorithm exist for which no such analysis has been possible question 2: what is elementary operation in terms of time measure? and why is time-demand...

How to measure program execution time in ARM Cortex-A8 processor?

Hi Guys, I'm using an ARM Cortex-A8 based processor called as i.MX515. There is linux Ubuntu 9.10 distribution. I'm running a very big application written in C and I'm making use of gettimeofday(); functions to measure the time my application takes. main() { gettimeofday(start); .... .... .... gettimeofday(end); } This method was ...

Delay added to sound

I'm going to write an application in Silverlight that consists of 2 threads, one that plays sound and another that records sound. And whatever is recorded will be what was played plus some ambient noise. The problem is that Silverlight adds a delay to the sound to be played, and because I don't know how much is this delay, I would not k...

logical time versus physical time in ubuntu linux

Hi, i am measuring physical time between two events like this: #include <time.h> #include <sys/time.h> timeval wall_time0; timeval wall_time1; // start of period measurement gettimeofday( &wall_time0 , 0); ...stuff happening // end of period measurement gettimeofday( &wall_time1 , 0); return ( ( wall_time1.tv_sec - wall_time0.tv_...