Mail Archives: djgpp/1998/02/10/20:45:55
Tom Chojnacki <chojnack AT quantum DOT de> writes:
> I want to measure time intervals in which some function executes itself.
> I used clock() function which returns time which elapsed since first
> call to clock(). But how can I reset the clock() to measure another time
> interval and not time since the first call again.
You don't have to reset it. Just save the return value from before,
and subtract it from the new one:
before = clock();
do_something();
after = clock();
elapsed = after - before;
- Raw text -