Using seTimer
We timed the two previous versions of the counting code using the following:
countLSRXForm(transm.getRoot());
printf("Count = %d LSR XForm = %d\n", _count, _lsrxform);
printf(" Time = %s\n", timer.toStr());
recurse(transm.getRoot());
printf("Count = %d LSR XForm = %d\n", _count, _lsrxform);
printf(" Time = %s\n", timer.toStr());
- No need to stop timer after printing. To reuse just call start() again.
- You can store elapsed times at several places by calling elapsed().
- Note the timer returns wall time currently. CPU (application) time is not implemented.