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:
authornicolabertoldi <nicolabertoldi@1f5c12ca-751b-0410-a591-d2e778427230>2009-01-07 16:30:06 +0300
committernicolabertoldi <nicolabertoldi@1f5c12ca-751b-0410-a591-d2e778427230>2009-01-07 16:30:06 +0300
commit4b4c1b3973ae32eacd0101552a5d9f51c5541965 (patch)
tree84268d41a39dd6e11ec545128495e0e195a5d60b /mert/Util.cpp
parent4ff372a6d6df0f0ca83a613f4e48c91c8deab538 (diff)
imported utilities for timing from Moses
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@1969 1f5c12ca-751b-0410-a591-d2e778427230
Diffstat (limited to 'mert/Util.cpp')
-rw-r--r--mert/Util.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/mert/Util.cpp b/mert/Util.cpp
index e7f263fdd..93e2231b2 100644
--- a/mert/Util.cpp
+++ b/mert/Util.cpp
@@ -9,6 +9,13 @@
#include <stdexcept>
#include "Util.h"
+#include "Timer.h"
+
+using namespace std;
+
+//global variable
+Timer g_timer;
+
int verbose=0;
int verboselevel(){
@@ -103,3 +110,18 @@ int swapbytes(char *p, int sz, int n)
};
+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();
+}
+