"printf" slow down benchmark result
I have to perform performance benchmark on a slow CPU with scarce memory resource. Doing a printf as shown below slow down the performance severely (There is another 'action start/end' benchmark in main()). For eg. from 40ms -> 4000ms :O. Is there any more efficient way to get time for benchmark result??
void func(){
struct timeval sTime;
gettimeofday(&sTime, NULL);
printf("SOAP sec start: \t %ld\n", sTime.tv_sec);
printf("SOAP usec start: \t %ld\n", sTime.tv_usec);
// SOAP parsing operation
printf("SOAP sec end: \t %ld\n", sTime.tv_sec);
printf("SOAP usec end: \t %ld\n", sTime.tv_usec);
}
|