| c# Programming Glossary: sw.startSystem.Diagnostics.Stopwatch returns negative numbers in Elapsed… properties http://stackoverflow.com/questions/1008345/system-diagnostics-stopwatch-returns-negative-numbers-in-elapsed-properties  to reproduce it. while true  Stopwatch sw new Stopwatch  sw.Start  sw.Stop  if sw.ElapsedMilliseconds 0  Debugger.Break  The only.. 
 Why does adding local variables make .NET code slower http://stackoverflow.com/questions/10369421/why-does-adding-local-variables-make-net-code-slower  static void Main string args Stopwatch sw new Stopwatch sw.Start int count 0 for uint i 0 i 1000000000 i  1st method var isMultipleOf16.. 
 Are Timers and Loops in .Net accurate? http://stackoverflow.com/questions/11531128/are-timers-and-loops-in-net-accurate  sw new System.Diagnostics.Stopwatch sw.Start this.Cursor Cursors.WaitCursor while true  if sw.ElapsedMilliseconds.. 
 \d is less efficient than [0-9] http://stackoverflow.com/questions/16621738/d-is-less-efficient-than-0-9  sw new Stopwatch  int successes 0 var rex new Regex regex sw.Start  foreach var str in strings   if rex.Match str .Success   successes.. 
 Wrapping StopWatch timing with a delegate or lambda? http://stackoverflow.com/questions/232848/wrapping-stopwatch-timing-with-a-delegate-or-lambda  doing a little quick and dirty timing var sw new Stopwatch sw.Start for int i 0 i 1000 i b DoStuff s sw.Stop Console.WriteLine sw.ElapsedMilliseconds.. this Stopwatch sw Action action int iterations  sw.Reset sw.Start for int i 0 i iterations i  action  sw.Stop return sw.ElapsedMilliseconds.. 
 C#. Struct design. Why 16 byte is recommended size? http://stackoverflow.com/questions/2407691/c-struct-design-why-16-byte-is-recommended-size  Class64 DoStuff s1 DoStuff c1 Stopwatch sw new Stopwatch sw.Start for int i 0 i 10000 i  s1 DoStuff s1  sw.Stop Console.WriteLine.. Console.WriteLine Struct 0 sw.ElapsedTicks sw.Reset sw.Start for int i 0 i 10000 i  c1 DoStuff c1  sw.Stop Console.WriteLine.. 
 How do I split a string by strings and include the delimiters using .NET? http://stackoverflow.com/questions/2484919/how-do-i-split-a-string-by-strings-and-include-the-delimiters-using-net  various orders in my tests  Stopwatch sw new Stopwatch  sw.Start  var func Functions funcId  var src Sources srcID  var del Delimiters.. 
 += new EventHandler(Method) vs += Method [duplicate] http://stackoverflow.com/questions/2749868/new-eventhandlermethod-vs-method  var counter new Counter Stopwatch sw new Stopwatch sw.Start for int i 0 i TestIterations i action counter sw.Stop return.. 
 C# Memoization of functions with arbitrary number of arguments http://stackoverflow.com/questions/2852161/c-sharp-memoization-of-functions-with-arbitrary-number-of-arguments  i  emaFunc.ClearMap remove any memoization mappings sw.Start emaFunc.Execute parameters sw.Stop sumTicks sw.ElapsedTicks.. numRuns sumTicks 0 Repeat call for int i 0 i numRuns i  sw.Start emaFunc.Execute parameters sw.Stop sumTicks sw.ElapsedTicks.. 
 How to get IP all hosts in LAN http://stackoverflow.com/questions/4042789/how-to-get-ip-all-hosts-in-lan  countdown new CountdownEvent 1 Stopwatch sw new Stopwatch  sw.Start  string ipBase 10.22.4. for int i 1 i 255 i   string ip ipBase.. 
 using static Regex.IsMatch vs creating an instance of Regex http://stackoverflow.com/questions/414328/using-static-regex-ismatch-vs-creating-an-instance-of-regex  static took 0 seconds. sw.Elapsed.TotalSeconds sw.Reset sw.Start Regex rx new Regex pattern for int i 0 i count i rx.IsMatch.. instance took 0 seconds. sw.Elapsed.TotalSeconds sw.Reset sw.Start rx new Regex pattern RegexOptions.Compiled for int i 0 i count.. 
 Any faster way of copying arrays in C#? http://stackoverflow.com/questions/5099604/any-faster-way-of-copying-arrays-in-c  static void TestBlockCopy  Stopwatch sw Stopwatch.StartNew sw.Start for int i 0 i COUNT i  Buffer.BlockCopy bSource 0 bTarget 0.. static void TestArrayCopy  Stopwatch sw Stopwatch.StartNew sw.Start for int i 0 i COUNT i  Array.Copy cSource 0 cTarget 0 SIZE sw.Stop.. 
 When are structs the answer? http://stackoverflow.com/questions/597259/when-are-structs-the-answer  method VectorStruct StructTest Stopwatch sw new Stopwatch sw.Start var v2 new VectorStruct 0 0 0 for int i 0 i 100000000 i var.. 
 Optimizing Lookups: Dictionary key lookups vs. Array index lookups http://stackoverflow.com/questions/908050/optimizing-lookups-dictionary-key-lookups-vs-array-index-lookups  i i intList.Add i int result var sw new Stopwatch sw.Start for int card1 0 card1 46 card1 for int card2 card1 1 card2 47.. dictionary lookups 0 ms sw.ElapsedMilliseconds sw.Reset sw.Start for int card1 0 card1 46 card1 for int card2 card1 1 card2 47.. 
 |