diff options
author | nicolabertoldi <nicolabertoldi@1f5c12ca-751b-0410-a591-d2e778427230> | 2009-01-07 16:30:06 +0300 |
---|---|---|
committer | nicolabertoldi <nicolabertoldi@1f5c12ca-751b-0410-a591-d2e778427230> | 2009-01-07 16:30:06 +0300 |
commit | 4b4c1b3973ae32eacd0101552a5d9f51c5541965 (patch) | |
tree | 84268d41a39dd6e11ec545128495e0e195a5d60b /mert/Util.cpp | |
parent | 4ff372a6d6df0f0ca83a613f4e48c91c8deab538 (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.cpp | 22 |
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(); +} + |