X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=flower%2Fcpu-timer.cc;h=37f735ffe9a24a245126494c25ae256420e805b2;hb=48ac2eda200097c5b79c7be7c85fbf720dcc1702;hp=c838fe5cc9116b9c83b10bb536442511faaa9300;hpb=5e47fbe9f5a8e10458a9d737d1c35cff2eae6791;p=lilypond.git diff --git a/flower/cpu-timer.cc b/flower/cpu-timer.cc index c838fe5cc9..37f735ffe9 100644 --- a/flower/cpu-timer.cc +++ b/flower/cpu-timer.cc @@ -3,16 +3,22 @@ source file of the Flower Library - (c) 1997 Han-Wen Nienhuys + (c) 1997--2007 Han-Wen Nienhuys */ #include "cpu-timer.hh" +#include // nextstep #ifndef CLOCKS_PER_SEC -#define CLOCKS_PER_SEC CLK_TCK +#ifdef CLK_TCK +#define CLOCKS_PER_SEC CLK_TCK +#elif defined _SC_CLK_TCK +#define CLOCKS_PER_SEC sysconf (_SC_CLK_TCK) +#else +#error cannot determine CLOCKS_PER_SEC +#endif #endif - Cpu_timer::Cpu_timer () { @@ -28,5 +34,5 @@ Real Cpu_timer::read () { clock_t stop = clock (); - return (stop-start_clock_)/Real(CLOCKS_PER_SEC); + return (stop - start_clock_) / Real (CLOCKS_PER_SEC); }