All articles

Melyik a gyorsabb?

Published 2007-08-10 - Last modified 2007-08-10

Original: https://soci.hu/blog/index.php/2007/08/10/melyik-a-gyorsabb/

És miért?

[source:C#]
Stopwatch st = Stopwatch.StartNew();
char a = ‘1’;
char b = ‘a’;
for (int i = 0; i < 1000 * 1000 * 10; i++) { //string s1 = new string(new char[] { a, b }); //string s2 = a.ToString() + b.ToString(); } st.Stop(); Console.WriteLine(st.Elapsed); [/source]