Skip to content
Snippets Groups Projects
Commit 10e201d9 authored by Tom Fischer's avatar Tom Fischer
Browse files

made time measurement in windows working

parent d590db2b
No related branches found
No related tags found
No related merge requests found
......@@ -2,16 +2,27 @@
void RunTimeTimer::start()
{
#ifndef _WIN32
gettimeofday(&_start, 0);
#else
_start = timeGetTime();
#endif
}
void RunTimeTimer::stop()
{
#ifndef _WIN32
gettimeofday(&_stop, 0);
#else
_stop = timeGetTime();
#endif
}
double RunTimeTimer::elapsed()
{
#ifndef _WIN32
return (_stop.tv_sec + _stop.tv_usec/1000000.0 - (_start.tv_sec + _start.tv_usec/1000000.0));
#else
return (_stop - _start) / 1000;
#endif
}
#ifndef RUNTIMETIMER_H
#define RUNTIMETIMER_H
#include "TimeMeasurementBase.h"
#ifndef _WIN32
#include <sys/time.h>
#else
#include <windows.h>
#endif
#include "TimeMeasurementBase.h"
class RunTimeTimer
class RunTimeTimer : public TimeMeasurementBase
{
public:
virtual void start();
virtual void stop();
virtual double elapsed();
virtual void start();
virtual void stop();
virtual double elapsed();
~RunTimeTimer() {};
private:
#ifndef _WIN32
timeval _start;
timeval _stop;
#else
unsigned long _start;
unsigned long _stop;
#endif
};
#endif
......@@ -19,6 +19,10 @@ ADD_EXECUTABLE( MatMult
${HEADERS}
)
IF (WIN32)
TARGET_LINK_LIBRARIES(MatMult Winmm.lib)
ENDIF (WIN32)
TARGET_LINK_LIBRARIES ( MatMult
Base
MathLib
......
......@@ -44,6 +44,9 @@ ADD_EXECUTABLE( GMResDiagPrecond
)
IF (WIN32)
TARGET_LINK_LIBRARIES(ConjugateGradientUnpreconditioned Winmm.lib)
ENDIF (WIN32)
TARGET_LINK_LIBRARIES ( ConjugateGradientUnpreconditioned
${BLAS_LIBRARIES}
${LAPACK_LIBRARIES}
......@@ -51,6 +54,9 @@ TARGET_LINK_LIBRARIES ( ConjugateGradientUnpreconditioned
Base
)
IF (WIN32)
TARGET_LINK_LIBRARIES(ConjugateGradientDiagPrecond Winmm.lib)
ENDIF (WIN32)
TARGET_LINK_LIBRARIES ( ConjugateGradientDiagPrecond
${BLAS_LIBRARIES}
${LAPACK_LIBRARIES}
......@@ -58,6 +64,9 @@ TARGET_LINK_LIBRARIES ( ConjugateGradientDiagPrecond
Base
)
IF (WIN32)
TARGET_LINK_LIBRARIES(BiCGStabDiagPrecond Winmm.lib)
ENDIF (WIN32)
TARGET_LINK_LIBRARIES( BiCGStabDiagPrecond
${BLAS_LIBRARIES}
${LAPACK_LIBRARIES}
......@@ -65,6 +74,9 @@ TARGET_LINK_LIBRARIES( BiCGStabDiagPrecond
Base
)
IF (WIN32)
TARGET_LINK_LIBRARIES(GMResDiagPrecond Winmm.lib)
ENDIF (WIN32)
TARGET_LINK_LIBRARIES( GMResDiagPrecond
${BLAS_LIBRARIES}
${LAPACK_LIBRARIES}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment