Menu

#6 Timing outputs in the demo Indexing apps

open
nobody
None
5
2013-01-10
2005-02-08
No

After indexing these apps run the following 2 lines:

System.Console.Out.Write(end.Ticks - start.Ticks);
System.Console.Out.WriteLine(" total milliseconds");

However a Tick is 100 nanoseconds, not a millisecond.
One fix for this is to change the code to:

System.Console.Out.Write((end.Ticks - start.Ticks) /
(TimeSpan.TicksPerSecond *1.0));
System.Console.Out.WriteLine(" total seconds");

Discussion


Log in to post a comment.

MongoDB Logo MongoDB