X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=flower%2Fcpu-timer.cc;h=37f735ffe9a24a245126494c25ae256420e805b2;hb=5186e9aa42b82929bc91c7ab0c2408f0d8acf5db;hp=e10985eee9849284fe30ca22b22bfee8f564b980;hpb=2181534bd94587fcac8f1769f2dda7bece693649;p=lilypond.git diff --git a/flower/cpu-timer.cc b/flower/cpu-timer.cc index e10985eee9..37f735ffe9 100644 --- a/flower/cpu-timer.cc +++ b/flower/cpu-timer.cc @@ -3,11 +3,23 @@ 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 +#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 () { restart (); @@ -22,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); }