]> www.ginac.de Git - ginac.git/blobdiff - check/timer.h
* Avoid getrusage(2) on systems that don't have it (by ASheplyakov Alexei
[ginac.git] / check / timer.h
index 2e76a6e1a6e8926095770815266d3172d96ccfe6..48e884acb521a5cb32deb0ae8259c139c8dcf48a 100644 (file)
 #ifndef TIMER_H
 #define TIMER_H
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#ifdef HAVE_RUSAGE
 #include <sys/resource.h>
+#else
+#include <ctime>
+#endif
 
 class timer {
 public:
@@ -35,7 +42,11 @@ public:
        bool running();
 private:
        bool on;
+#ifdef HAVE_RUSAGE
        struct rusage used1, used2;
+#else
+       std::clock_t used1, used2;
+#endif
 };
 
 #endif // ndef TIMER_H