Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Parse Performance Test

By: a guest on May 29th, 2010  |  syntax: C#  |  size: 0.31 KB  |  hits: 89  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. long l;
  2. string strLong = "1";
  3.  
  4. Stopwatch s = new Stopwatch();
  5. s.Start();
  6. for(int i = 0; i < 10000000; i++) {
  7.         long.TryParse(strLong, out l);
  8. }
  9. s.Stop();
  10. s.ElapsedMilliseconds.Dump("Try Parse:");
  11. s.Restart();
  12. for(int i = 0; i < 10000000; i++) {
  13.         long.Parse(strLong);
  14. }
  15. s.ElapsedMilliseconds.Dump("Parse:");