Milliseconds

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Nepomuk
    Recognized Expert Specialist
    • Aug 2007
    • 3111

    Milliseconds

    Hi everyone!
    A question, that I was asked and knew no answer to:
    For time, normally the class clock is used, but that's only exact to the second. If however milliseconds are wanted, how can you get them? And no, multiplying it with 1000 is not a solution, because it's still no more exact.

    Basically, I'm looking for something like Java's [code=java]System.currentT imeMillis()[/code]
    Greetings,
    Nepomuk
  • gpraghuram
    Recognized Expert Top Contributor
    • Mar 2007
    • 1275

    #2
    Originally posted by nepomuk
    Hi everyone!
    A question, that I was asked and knew no answer to:
    For time, normally the class clock is used, but that's only exact to the second. If however milliseconds are wanted, how can you get them? And no, multiplying it with 1000 is not a solution, because it's still no more exact.

    Basically, I'm looking for something like Java's [code=java]System.currentT imeMillis()[/code]
    Greetings,
    Nepomuk
    You can get it by using clock_gettime in unix and _ftime in windows.
    Check this link for an example

    raghuram

    Comment

    • Nepomuk
      Recognized Expert Specialist
      • Aug 2007
      • 3111

      #3
      Originally posted by gpraghuram
      You can get it by using clock_gettime in unix and _ftime in windows.
      Check this link for an example

      raghuram
      Thanks, that should help a lot!

      Greetings,
      Nepomuk

      Comment

      Working...