Quote:
Originally Posted by Alan Anderson
I believe you have declared the wrong variable as static. The way it stands now, i will be set to 1 then incremented to 2 each time through the loop, and time_i will always be computed as 0. If you change it to say
Code:
static int i = 1;
int time_i;
instead, i will remember its value between loops and be incremented as desired, and time_i will do as neilsonster said...
...at least until 125 loops have occurred, after a bit more than 3.25 seconds, after which time (i * 262) will overflow and you'll start getting negative results.
|
Ok kool, i'll just switch that now