private void Generator_Click(object sender, RoutedEventArgs e) { Stopwatch time = Stopwatch.StartNew(); AfrikaKataster.Generator(); time.Stop(); var cas = time.Elapsed; MessageBox.Show("Vygenerovane cas : " + cas, "OK"); }