Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Issue using times function in Intel MAC
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="sjain" data-source="post: 239353"><p>Thanks for the response Cazabam.</p><p>However, I did exactly the same before seeking help in this forum. </p><p></p><p>But i have one issue regarding it. Kindly do correct if i am wrong in my assumption.</p><p></p><p>I tried the following on linux where i have times function running fine:</p><p></p><p>gettimeofday(&tp, NULL);</p><p>clocks_per_second = sysconf(_SC_CLK_TCK);</p><p>cpu_time = (tp.tv_sec * CLOCKS_PER_SEC);</p><p></p><p>tm = times(NULL);</p><p></p><p>However the output of cpu_time and tm is not the same. Isnt it supposed to be same if even times function does the same. The 2 values are coming out to be quite different, which made me dubious if this is the right way of calculating the value of time in clock ticks.</p><p></p><p>Hoping for a quick early response.</p><p>Thanks</p><p>-Sachin</p></blockquote><p></p>
[QUOTE="sjain, post: 239353"] Thanks for the response Cazabam. However, I did exactly the same before seeking help in this forum. But i have one issue regarding it. Kindly do correct if i am wrong in my assumption. I tried the following on linux where i have times function running fine: gettimeofday(&tp, NULL); clocks_per_second = sysconf(_SC_CLK_TCK); cpu_time = (tp.tv_sec * CLOCKS_PER_SEC); tm = times(NULL); However the output of cpu_time and tm is not the same. Isnt it supposed to be same if even times function does the same. The 2 values are coming out to be quite different, which made me dubious if this is the right way of calculating the value of time in clock ticks. Hoping for a quick early response. Thanks -Sachin [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Issue using times function in Intel MAC
Top