using System;
using System.Text;

class StringSpeed
{
    static void Main()
    {
        string a = "";
        string b = "Hallo";
        int times = 100000;
        long start, end;

        // String-Version
        start = DateTime.Now.Ticks;

        for (int i = 0; i < times; i++)
            a += b;

        end = DateTime.Now.Ticks;
        Console.WriteLine("String       : " + (end - start) + " ticks");


        // StringBuilder-Version
        StringBuilder sb = new StringBuilder();
        start = DateTime.Now.Ticks;

        for (int i = 0; i < times; i++)
            sb.Append(b);

        string c = sb.ToString();
        end = DateTime.Now.Ticks;
        Console.WriteLine("StringBuilder: " + (end - start) + " ticks");
    }
}