[gbrainy] Show startup time at load
- From: Jordi Mas <jmas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gbrainy] Show startup time at load
- Date: Sun, 18 Jul 2010 06:54:01 +0000 (UTC)
commit 0f6e7dea2d4805de1950f75ebe4598e6d6cf6225
Author: Jordi Mas <jmas softcatala org>
Date: Sun Jul 18 08:55:17 2010 +0200
Show startup time at load
src/Clients/Classical/CommandLine.cs | 15 ++++++---------
src/Clients/Classical/gbrainy.cs | 8 +++++++-
src/Core/Main/Verbal/AnalogiesFactory.cs | 13 -------------
3 files changed, 13 insertions(+), 23 deletions(-)
---
diff --git a/src/Clients/Classical/CommandLine.cs b/src/Clients/Classical/CommandLine.cs
index c5436de..3dfb43d 100644
--- a/src/Clients/Classical/CommandLine.cs
+++ b/src/Clients/Classical/CommandLine.cs
@@ -80,7 +80,6 @@ namespace gbrainy.Clients.Classical
RandomOrder = false;
break;
case "--version":
- Version ();
cont_execution = false;
break;
case "--versions":
@@ -99,6 +98,12 @@ namespace gbrainy.Clients.Classical
}
}
+ public static void Version ()
+ {
+ Console.WriteLine ("gbrainy " + Defines.VERSION + " " +
+ String.Format (Catalog.GetString ("(build on {0})"), Defines.BUILD_TIME));
+ }
+
static void GameList ()
{
GameManager.GameLocator [] games;
@@ -175,19 +180,11 @@ namespace gbrainy.Clients.Classical
" --norandom \t\t\tThe custom game list provided will not be randomized.\n" +
" --versions \t\t\tShow dependencies.\n");
- Version ();
Console.WriteLine (usage);
}
- static void Version ()
- {
- Console.WriteLine ("gbrainy " + Defines.VERSION + " " +
- String.Format (Catalog.GetString ("(build on {0})"), Defines.BUILD_TIME));
- }
-
static void Versions ()
{
- Version ();
Console.WriteLine ("Mono .NET Version: " + Environment.Version.ToString());
Console.WriteLine (String.Format("{0}Assembly Version Information:", Environment.NewLine));
diff --git a/src/Clients/Classical/gbrainy.cs b/src/Clients/Classical/gbrainy.cs
index d0abc6a..f113ca1 100644
--- a/src/Clients/Classical/gbrainy.cs
+++ b/src/Clients/Classical/gbrainy.cs
@@ -684,7 +684,11 @@ namespace gbrainy.Clients.Classical
Unix.SetProcessName ("gbrainy");
} catch {}
+ DateTime start_time = DateTime.Now;
+
GtkClient app = new GtkClient ();
+ CommandLine.Version ();
+
CommandLine line = new CommandLine (args);
line.Parse ();
@@ -697,8 +701,10 @@ namespace gbrainy.Clients.Classical
app.InitialSessionType = GameSession.Types.Custom;
}
app.Session.GameManager.RandomOrder = line.RandomOrder;
-
app.ProcessDefaults ();
+
+ TimeSpan span = DateTime.Now - start_time;
+ Console.WriteLine (Catalog.GetString ("Startup time {0}"), span);
app.Run ();
}
}
diff --git a/src/Core/Main/Verbal/AnalogiesFactory.cs b/src/Core/Main/Verbal/AnalogiesFactory.cs
index 5f6d953..caa0b97 100644
--- a/src/Core/Main/Verbal/AnalogiesFactory.cs
+++ b/src/Core/Main/Verbal/AnalogiesFactory.cs
@@ -145,19 +145,6 @@ namespace gbrainy.Core.Main.Verbal
reader.Close ();
read = true;
-
- int cnt = 0;
- for (int i = 0; i < (int) Analogy.Type.Last; i++)
- {
- cnt += analogies_arrays[i].Count;
-
- if (analogies_arrays[i].Count > 0) {
- Console.WriteLine (Catalog.GetString ("Read {0} verbal analogies of type {1}"), analogies_arrays[i].Count,
- analogies_arrays[i][0].type.ToString ());
- }
- }
-
- Console.WriteLine (Catalog.GetString ("Read a total of {0} verbal analogies"), cnt);
}
catch (Exception e)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]