Re: Strange time() behaviour
- Posted by Matt Lewis <matthewwalkerlewis at gmail.com> Apr 08, 2007
- 550 views
Leonardo Cecchi wrote: > > So I think the problem is the definition of the macro CLK_TCK. > In fact, in the global.h file, I found the following instructions: > > #ifndef CLK_TCK > #define CLK_TCK CLOCKS_PER_SEC > #endif > > But, with ubuntu, the value of CLK_TCK is diffent > from the value of CLOCKS_PER_SEC. > Yep. I clearly didn't understand what was going on with this before, when I created this macro. I've fixed it up in the repository now. It doesn't define CLK_TCK at all, but rather fixes the value of clk_tck to use sysconf(_SC_CLK_TCK) instead. There was one place in be_execute.c that used the macro instead of the value, and I had to update compile.e to use this, too. I now get the correct result with Ubuntu. Matt