mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-26 21:42:19 +03:00
compile error on mac osx. Just #ifdef for now, but should use Boost or something to make it cross-platform. It keeps happening
This commit is contained in:
parent
1c81c5582f
commit
33588b702c
@ -36,7 +36,9 @@ const char *SkipSpaces(const char *at) {
|
|||||||
class RecordStart {
|
class RecordStart {
|
||||||
public:
|
public:
|
||||||
RecordStart() {
|
RecordStart() {
|
||||||
|
#ifdef CLOCK_MONOTONIC
|
||||||
clock_gettime(CLOCK_MONOTONIC, &started_);
|
clock_gettime(CLOCK_MONOTONIC, &started_);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct timespec &Started() const {
|
const struct timespec &Started() const {
|
||||||
@ -77,7 +79,9 @@ void PrintUsage(std::ostream &out) {
|
|||||||
out << "CPU:" << (FloatSec(usage.ru_utime) + FloatSec(usage.ru_stime));
|
out << "CPU:" << (FloatSec(usage.ru_utime) + FloatSec(usage.ru_stime));
|
||||||
|
|
||||||
struct timespec current;
|
struct timespec current;
|
||||||
|
#ifdef CLOCK_MONOTONIC
|
||||||
clock_gettime(CLOCK_MONOTONIC, ¤t);
|
clock_gettime(CLOCK_MONOTONIC, ¤t);
|
||||||
|
#endif
|
||||||
out << "\treal:" << (FloatSec(current) - FloatSec(kRecordStart.Started())) << '\n';
|
out << "\treal:" << (FloatSec(current) - FloatSec(kRecordStart.Started())) << '\n';
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user