By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,558 Members | 1,373 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,558 IT Pros & Developers. It's quick & easy.

getting time in milliseconds

P: n/a
Hi ,
can anyone tell me how to find time in milliseconds on mac os . Is
there any function in standard library for same .

Regards
Mangesh .

Apr 23 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Markus Schoder wrote:
mangesh wrote:
Hi ,
can anyone tell me how to find time in milliseconds on mac os . Is
there any function in standard library for same .


There is a C++ standard function called time() but it only has second
resolution.


This is not correct. From the C draft standard:

7.23.2.4 The time function

Description

[#2] The time function determines the current calendar time.
The encoding of the value is unspecified.

Returns

[#3] The time function returns the implementation's best
approximation to the current calendar time. The value
(time_t)-1 is returned if the calendar time is not
available. If timer is not a null pointer, the return value
is also assigned to the object it points to.


Brian
Apr 23 '06 #2

P: n/a
In article <11*********************@g10g2000cwb.googlegroups. com>,
"mangesh" <ma************@walla.com> wrote:
Hi ,
can anyone tell me how to find time in milliseconds on mac os . Is
there any function in standard library for same .


If you want to keep it standard:

Look up "clock()", the best resolution the standard can give you is
1/CLK_TCK second

http://www.cplusplus.com/ref/ctime/
Apr 25 '06 #3

P: n/a
In article <postmaster-1CF23A.23055224042006
@news.east.earthlink.net>, po********@verizon.net says...

[ ... ]
Look up "clock()", the best resolution the standard can give you is
1/CLK_TCK second


I suppose that depends on which standard you follow.
CLK_TCK is (if memory serves) in the POSIX standard, but
the C and C++ standards call it CLOCKS_PER_SEC.

--
Later,
Jerry.

The universe is a figment of its own imagination.
Apr 26 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.