time.h



 DEVELOP > c-Plus-Plus > time.h

LINK TO THIS PAGE  


rating :  0   |  0


  Page 1 of 1

1

 
Topic: DEVELOP > c-Plus-Plus
User: "Szymon Bobek"
Date: 11 Dec 2004 07:04:42 AM
Object: 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
.

User: "Eric Boutin"

Title: [OT]Re: time.h 11 Dec 2004 07:53:46 AM
On Sat, 11 Dec 2004 14:04:42 +0100, Szymon Bobek wrote :

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

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 :
http://www.gnu.org/software/libc/manual/html_mono/libc.html#Date%20and%20Time
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@users.sourceforge.net
.
User: "Jens"

Title: Re: [OT]Re: time.h 12 Dec 2004 12:09:15 PM
Eric Boutin wrote:

On Sat, 11 Dec 2004 14:04:42 +0100, Szymon Bobek wrote :

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



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 :

http://www.gnu.org/software/libc/manual/html_mono/libc.html#Date%20and%20Time



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


hope it helped

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
.



  Page 1 of 1

1

 


Related Articles
 

NEWER

pg.1232     pg.940     pg.716     pg.544     pg.412     pg.311     pg.234     pg.175     pg.130     pg.96     pg.70     pg.50     pg.35     pg.24     pg.16     pg.10     pg.6     pg.3     pg.1

OLDER