mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 11:25:40 +03:00
delete CLOCK_MONOTONIC
This commit is contained in:
parent
a0927b98e6
commit
eb789874ea
@ -1,5 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||
<?fileVersion 4.0.0?>
|
||||
|
||||
<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
||||
<cconfiguration id="cdt.managedbuild.config.gnu.exe.debug.162355801">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.debug.162355801" moduleId="org.eclipse.cdt.core.settings" name="Debug">
|
||||
@ -74,7 +76,6 @@
|
||||
<listOptionValue builtIn="false" value="boost_system-mt"/>
|
||||
<listOptionValue builtIn="false" value="boost_thread-mt"/>
|
||||
<listOptionValue builtIn="false" value="boost_filesystem-mt"/>
|
||||
<listOptionValue builtIn="false" value="rt"/>
|
||||
</option>
|
||||
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.128214028" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
|
||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||
@ -155,8 +156,13 @@
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
|
||||
</scannerConfigBuildInfo>
|
||||
</storageModule>
|
||||
<storageModule moduleId="refreshScope" versionNumber="1">
|
||||
<resource resourceType="PROJECT" workspacePath="/moses-chart-cmd"/>
|
||||
<storageModule moduleId="refreshScope" versionNumber="2">
|
||||
<configuration configurationName="Release">
|
||||
<resource resourceType="PROJECT" workspacePath="/moses-chart-cmd"/>
|
||||
</configuration>
|
||||
<configuration configurationName="Debug">
|
||||
<resource resourceType="PROJECT" workspacePath="/moses-chart-cmd"/>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
||||
|
@ -1,5 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||
<?fileVersion 4.0.0?>
|
||||
|
||||
<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
||||
<cconfiguration id="cdt.managedbuild.config.gnu.exe.debug.461114338">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.debug.461114338" moduleId="org.eclipse.cdt.core.settings" name="Debug">
|
||||
@ -72,7 +74,6 @@
|
||||
<listOptionValue builtIn="false" value="boost_thread-mt"/>
|
||||
<listOptionValue builtIn="false" value="lm"/>
|
||||
<listOptionValue builtIn="false" value="util"/>
|
||||
<listOptionValue builtIn="false" value="rt"/>
|
||||
</option>
|
||||
<option id="gnu.cpp.link.option.userobjs.1542590830" name="Other objects" superClass="gnu.cpp.link.option.userobjs" valueType="userObjs">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc}/../../boost/lib64/libboost_system-mt.a""/>
|
||||
|
@ -15,17 +15,9 @@ namespace Moses
|
||||
*/
|
||||
double Timer::elapsed_time()
|
||||
{
|
||||
#ifdef CLOCK_MONOTONIC
|
||||
struct timespec now;
|
||||
clock_gettime(CLOCK_MONOTONIC, &now);
|
||||
double elapsed = (now.tv_sec - start_time.tv_sec);
|
||||
elapsed += (now.tv_nsec - start_time.tv_nsec) / 1000000000.0;
|
||||
return elapsed;
|
||||
#else
|
||||
time_t now;
|
||||
time(&now);
|
||||
return difftime(now, start_time);
|
||||
#endif
|
||||
}
|
||||
|
||||
/***
|
||||
@ -56,11 +48,7 @@ void Timer::start(const char* msg)
|
||||
running = true;
|
||||
|
||||
// Set the start time;
|
||||
#ifdef CLOCK_MONOTONIC
|
||||
clock_gettime(CLOCK_MONOTONIC, &start_time);
|
||||
#else
|
||||
time(&start_time);
|
||||
#endif
|
||||
}
|
||||
|
||||
/***
|
||||
|
@ -22,11 +22,7 @@ private:
|
||||
bool running;
|
||||
// note: this only has the resolution of seconds, we'd often like better resolution
|
||||
// we make our best effort to do this on a system-by-system basis
|
||||
#ifdef CLOCK_MONOTONIC
|
||||
struct timespec start_time;
|
||||
#else
|
||||
time_t start_time;
|
||||
#endif
|
||||
|
||||
// in seconds
|
||||
double elapsed_time();
|
||||
@ -37,12 +33,7 @@ public:
|
||||
* using 'start' or 'restart'
|
||||
*/
|
||||
Timer() : running(false) {
|
||||
#ifdef CLOCK_MONOTONIC
|
||||
start_time.tv_sec = 0;
|
||||
start_time.tv_nsec = 0;
|
||||
#else
|
||||
start_time = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
void start(const char* msg = 0);
|
||||
|
Loading…
Reference in New Issue
Block a user