Last active
December 18, 2015 20:48
-
-
Save hagbarddenstore/5842290 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It took 103 µs allocating an array with size 4000000 | |
It took 37441 µs allocating an array with size 4000000 | |
It took 43746 µs allocating an array with size 4000000 | |
It took 42006 µs allocating an array with size 4000000 | |
It took 41468 µs allocating an array with size 4000000 | |
It took 42477 µs allocating an array with size 4000000 | |
It took 43270 µs allocating an array with size 4000000 | |
It took 41336 µs allocating an array with size 4000000 | |
It took 42487 µs allocating an array with size 4000000 | |
It took 41911 µs allocating an array with size 4000000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void Main(string[] args) | |
{ | |
for (var i = 0; i < 10; i++) | |
{ | |
var stopwatch = Stopwatch.StartNew(); | |
var strings = new string[4000000]; | |
stopwatch.Stop(); | |
Debug.WriteLine("It took {0} µs allocating an array with size {1}", stopwatch.Elapsed.Ticks / (Stopwatch.Frequency / 1000000), strings.Length); | |
} | |
Console.WriteLine("Press Enter to exit..."); | |
Console.ReadLine(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment