January 2011
Intermediate to advanced
1648 pages
70h 30m
English
StopWatchPerformance measurement of pieces of code should be done using a precise-enough time to have any value whatsoever. Just subtracting DateTime values doesn’t cut it because of the relatively low resolution of DateTime values. To prove this point, enter the following piece of code, which computes 50 factorial a number of times:

Feel free to increase the outer loop’s iteration count. In any case, the output shouldn’t make much sense because some of the factorial calculations turn out to take no time (that is, printing 00:00:00), whereas others take 1 or more milliseconds. Obviously, there’s always a chance of ...
Read now
Unlock full access