getting time in milliseconds

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mangesh

    getting time in milliseconds

    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 .

  • Default User

    #2
    Re: getting time in milliseconds

    Markus Schoder wrote:
    [color=blue]
    > mangesh wrote:[color=green]
    > > Hi ,
    > > can anyone tell me how to find time in milliseconds on mac os . Is
    > > there any function in standard library for same .[/color]
    >
    > There is a C++ standard function called time() but it only has second
    > resolution.[/color]

    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

    Comment

    • Daniel T.

      #3
      Re: getting time in milliseconds

      In article <1145809692.555 467.41260@g10g2 000cwb.googlegr oups.com>,
      "mangesh" <mangesh_sawant @walla.com> wrote:
      [color=blue]
      > Hi ,
      > can anyone tell me how to find time in milliseconds on mac os . Is
      > there any function in standard library for same .[/color]

      If you want to keep it standard:

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


      Comment

      • Jerry Coffin

        #4
        Re: getting time in milliseconds

        In article <postmaster-1CF23A.23055224 042006
        @news.east.eart hlink.net>, postmaster@veri zon.net says...

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

        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.

        Comment

        Working...