Created
December 13, 2013 17:07
-
-
Save kumpera/7947579 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
using System; | |
using System.Diagnostics; | |
class Foo<T> {} | |
class Program | |
{ | |
static string x = "1010203830649659101020383064965910102038306496591010203830649659101020383064965910102038306496591010203830649659101020383064965910102038306496591010203830649659101020383064965910102038306496591010203830649659" + | |
"1010203830649659101020383064965910102038306496591010203830649659101020383064965910102038306496591010203830649659101020383064965910102038306496591010203830649659101020383064965910102038306496591010203830649659" + | |
"1010203830649659101020383064965910102038306496591010203830649659101020383064965910102038306496591010203830649659101020383064965910102038306496591010203830649659101020383064965910102038306496591010203830649659" + | |
"1010203830649659101020383064965910102038306496591010203830649659101020383064965910102038306496591010203830649659101020383064965910102038306496591010203830649659101020383064965910102038306496591010203830649659" + | |
"1010203830649659101020383064965910102038306496591010203830649659101020383064965910102038306496591010203830649659101020383064965910102038306496591010203830649659101020383064965910102038306496591010203830649659" + | |
"1010203830649659101020383064965910102038306496591010203830649659101020383064965910102038306496591010203830649659101020383064965910102038306496591010203830649659101020383064965910102038306496591010203830649659" + | |
"1010203830649659101020383064965910102038306496591010203830649659101020383064965910102038306496591010203830649659101020383064965910102038306496591010203830649659101020383064965910102038306496591010203830649659"; | |
static int Bench () | |
{ | |
int acc = 0; | |
for (int i = 0; i < 1000 * 1000; ++i) | |
acc += x.GetHashCode (); | |
return acc; | |
} | |
static void Main(string[] args) | |
{ | |
var sw = Stopwatch.StartNew (); | |
Bench (); | |
sw.Stop (); | |
sw = Stopwatch.StartNew (); | |
Bench (); | |
sw.Stop (); | |
Console.WriteLine ("It took {0}ms", sw.ElapsedMilliseconds); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment