Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Madl <git@abanbytes.eu>2015-11-10 17:01:05 +0300
committerDavid Madl <git@abanbytes.eu>2015-11-17 19:15:13 +0300
commit3b6393094394cd19eee61b64e467b055a88033d4 (patch)
tree7f7b2afe19ae7a30a85556e7263b7608098fe19e /moses/Timer.cpp
parent0dd6c31f638de16bd9dd6abb3113e15b719dce2c (diff)
move global Timer to Timer.h
Move ResetUserTime(), PrintUserTime(), GetUserTime() to Timer.h Do not reset timer in StaticData.
Diffstat (limited to 'moses/Timer.cpp')
-rw-r--r--moses/Timer.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/moses/Timer.cpp b/moses/Timer.cpp
index 6128ab885..a10e51606 100644
--- a/moses/Timer.cpp
+++ b/moses/Timer.cpp
@@ -9,6 +9,26 @@
namespace Moses
{
+//global variable
+Timer g_timer;
+
+
+void ResetUserTime()
+{
+ g_timer.start();
+};
+
+void PrintUserTime(const std::string &message)
+{
+ g_timer.check(message.c_str());
+}
+
+double GetUserTime()
+{
+ return g_timer.get_elapsed_time();
+}
+
+
/***
* Return the total wall time that the timer has been in the "running"
* state since it was first "started".