time.h

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

    #1

    time.h

    Hello,
    Is it possible to get time with precission to 1/100 of second using time.h?
    If yes - how? If not - where should I search for function which can do it?

    Thanx,
    Szymon


  • Eric Boutin

    #2
    [OT]Re: time.h

    On Sat, 11 Dec 2004 14:04:42 +0100, Szymon Bobek wrote :
    [color=blue]
    > Hello,
    > Is it possible to get time with precission to 1/100 of second using time.h?
    > If yes - how? If not - where should I search for function which can do it?
    >
    > Thanx,
    > Szymon[/color]


    first time.h is deprecated;
    you should use <ctime> instead;


    here's the reference for this header :


    there's no miliseconds.. I think you'll have to be OS-specifics..

    if programming for POSIX, go read this :



    If programming for Windows, the windows multimedia librairy have what you
    need. gettime or timegettime not shure... lookup msdn


    hope it helped

    --
    ========
    Eric Boutin
    ericboutin@user s.sourceforge.n et

    Comment

    • Jens

      #3
      Re: [OT]Re: time.h

      Eric Boutin wrote:
      [color=blue]
      > On Sat, 11 Dec 2004 14:04:42 +0100, Szymon Bobek wrote :
      >[color=green]
      >> Hello,
      >> Is it possible to get time with precission to 1/100 of second using
      >> time.h? If yes - how? If not - where should I search for function which
      >> can do it?
      >>
      >> Thanx,
      >> Szymon[/color]
      >
      >
      > first time.h is deprecated;
      > you should use <ctime> instead;
      >
      >
      > here's the reference for this header :
      > http://www.cplusplus.com/ref/ctime/
      >
      > there's no miliseconds.. I think you'll have to be OS-specifics..
      >
      > if programming for POSIX, go read this :
      >[/color]
      http://www.gnu.org/software/libc/man...e%20and%20Time[color=blue]
      >
      >
      > If programming for Windows, the windows multimedia librairy have what you
      > need. gettime or timegettime not shure... lookup msdn
      >
      >
      > hope it helped
      >[/color]
      Hi!

      You can uses something like this:

      while(){
      clock_t clockTemp = 0;
      clock_t clockA = clock();

      operationer

      clock_t clockB = clock();
      clockTemp += (clockB-clockA);
      }

      clockTemp/CLOCKS_PER_SEC;

      Jens

      Comment

      Working...