Commit Graph

7 Commits

Author SHA1 Message Date
Jeroen Vermeulen
1083999d3e Adapt test to poor Windows timer resolution.
TimerTest fails on Windows unless the sleep time is set to at least a
millisecond (1,000 microseconds).  Keep it nice and low for other platforms
though, because the sleep time is wasted.
2015-04-22 12:45:41 +07:00
Hieu Hoang
6249432407 beautify 2013-05-29 18:16:15 +01:00
Hieu Hoang
121e258e84 namespace all classes in mert directory 2012-06-30 21:39:10 +01:00
Tetsuo Kiso
ee5174de58 Delete assertions to check elapsed CPU time.
The accuracy of getrusage() is limited by the resolution
of software clock as described in
http://www.kernel.org/doc/man-pages/online/pages/man7/time.7.html

The assertions required a timer with microsecond accuracy.
However, we don't necessarily want the timer, and we don't
want to add some time-consuming processes to the test code because
we normally build programs again and again, which means
we want to run unit tests as quickly as possible.
2012-03-03 23:24:08 +09:00
Tetsuo Kiso
7735670a57 Disable failed assertions of TimerTest anyway.
This commit is kludgy. A better solution to the problem will be pushed.
Note that the assertions have no impact on the MERT process.
2012-02-29 12:38:02 +09:00
Tetsuo Kiso
b99ebb7a19 Fix failure of the Timer unit test. 2012-02-28 12:34:40 +09:00
Tetsuo Kiso
7093d2e2cd Change mert/Timer.
- Add a high resolution timing function to measure the
  wall-clock time by gettimeofday().

- Now the Timer class use getrusage() to measure the elapsed
  CPU time as KenLM does.

- Revive Timer::restart().

- Add Timer::ToString() for reporting the detail statistics
  as well as for debugging.

- Add a simple unit test for Timer.
2012-02-27 08:34:51 +09:00