Re: Anybody may help to explain the issue of the source code , next "try-throw-catch" will cost more cpu time than previous one

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



f z wrote:
> Hi everyone,
> I test some code and I found that "next 'try-throw-catch' will cost more cpu time than previous one". Could you help to explain this case !! 

Try using clock(3) instead of gettimeofday(2).

I see quite a lot of variation in the time taken: sometimes
slower, sometimes faster.  I'm not sure what causes this
variation, and you'd have to use oprofile or something
similar to find out.  Some variation is inevitable, due
to the OS process scheduling.

Andrew.


start0:0
end  0:13320000
totle0:13320000
******************
start1:13320000
end  1:28000000
totle1:14680000
******************
start2:28000000
end  2:43870000
totle2:15870000
******************
start3:43870000
end  3:61100000
totle3:17230000
******************
start0:61100000
end  0:74440000
totle0:13340000
******************
start1:74440000
end  1:89120000
totle1:14680000
******************
start2:89120000
end  2:104980000
totle2:15860000
******************
start3:104980000
end  3:122200000
totle3:17220000
******************
start0:122200000
end  0:135560000
totle0:13360000
******************
start1:135560000
end  1:150250000
totle1:14690000
******************
start2:150250000

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux