getting time in milliseconds

M

mangesh

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 .
 
D

Default User

Markus said:
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
 
J

Jerry Coffin

[ ... ]
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top