"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "projects/CodeThorn/src/TimeMeasurement.C" between
rose-0.11.49.0.tar.gz and rose-0.11.50.0.tar.gz

About: ROSE is a compiler infrastructure to build source-to-source program transformation and analysis tools for large-scale C, C++, UPC, Fortran, OpenMP, Java, Python and PHP applications.

TimeMeasurement.C  (rose-0.11.49.0):TimeMeasurement.C  (rose-0.11.50.0)
skipping to change at line 102 skipping to change at line 102
void TimeMeasurement::resume() { void TimeMeasurement::resume() {
if(state==TIME_RUNNING) { if(state==TIME_RUNNING) {
throw std::runtime_error("Time Measurement: error 6: resume(): TimeMeasureme nt not stopped (state: RUNNING)."); throw std::runtime_error("Time Measurement: error 6: resume(): TimeMeasureme nt not stopped (state: RUNNING).");
} else { } else {
state=TIME_RUNNING; state=TIME_RUNNING;
} }
} }
TimeDuration TimeMeasurement::getTimeDuration() { TimeDuration TimeMeasurement::getTimeDuration() {
if(state==TIME_RUNNING) { //if(state==TIME_RUNNING) {
throw std::runtime_error("Time Measurement: error 3: : getTimeDuration: Time //throw std::runtime_error("Time Measurement: error 3: : getTimeDuration: Time
Measurement not stopped (state: RUNNING)."); Measurement not stopped (state: RUNNING).");
//}
switch(state) {
case TIME_RUNNING: {
stop();
TimeDuration td=TimeDuration((endCount.tv_sec-startCount.tv_sec)*1000000.0+(
endCount.tv_usec-startCount.tv_usec));
resume();
return td;
}
case TIME_STOPPED: {
TimeDuration td=TimeDuration((endCount.tv_sec-startCount.tv_sec)*1000000.0+(
endCount.tv_usec-startCount.tv_usec));
return td;
}
default:
throw std::runtime_error("Time Measurement: error 5: : unknown state (not RU
NNING, not STOPPED).");
} }
TimeDuration td=TimeDuration((endCount.tv_sec-startCount.tv_sec)*1000000.0+(en
dCount.tv_usec-startCount.tv_usec));
return td;
} }
TimeDuration TimeMeasurement::getTimeDurationAndKeepRunning() { TimeDuration TimeMeasurement::getTimeDurationAndKeepRunning() {
if(state==TIME_STOPPED) { if(state==TIME_STOPPED) {
throw std::runtime_error("Time Measurement: error 4: : getTimeDurationAndKee pRunning: TimeMeasurement already stopped, cannot keep it running (state: STOPPE D)."); throw std::runtime_error("Time Measurement: error 4: : getTimeDurationAndKee pRunning: TimeMeasurement already stopped, cannot keep it running (state: STOPPE D).");
} }
stop(); stop();
TimeDuration td=TimeDuration((endCount.tv_sec-startCount.tv_sec)*1000000.0+(en dCount.tv_usec-startCount.tv_usec)); TimeDuration td=TimeDuration((endCount.tv_sec-startCount.tv_sec)*1000000.0+(en dCount.tv_usec-startCount.tv_usec));
resume(); resume();
return td; return td;
 End of changes. 2 change blocks. 
6 lines changed or deleted 20 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)