🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #1108

Re: Need help with defining time

#1108
From: Colin Plumb
Date: Thu, 22 Mar 1990 02:50
26 lines
1657 bytes
In article <1990Mar21.195807.13318@IDA.ORG> westphal@IDA.ORG.UUCP (Christopher Westphal) writes:
>I recently purchased a copy of Turbo C, for a 286 IBM.
>
>After reviewing the manuals, I can't find how to get time
>intervals in the millisecond range. There is a header file
>that can be used with Unix, but does me no good.
>
>So...if anyone knows how to get time in milliseconds, please
>let me know!!!

The most accurate time provided by ANSI C is from the function
clock(), which returns the number of CLOCKS_PER_SEC ticks of
processor time (in the case of an IBM clone running single-user,
elapsed time) used by the process.  If CLOCKS_PER_SEC is less than
1000 (I suspect it's something like 18.2) on your implementation,
the ANSI C standard can't help you, sorry.

Your implementation may also define the return value from time()
(unspecified in the standard) in a useful way.

These are (as far as I understand the Decmeber 7, 1988 draft I'm using; 
other greater experts may correct me) the only standard C functions for
obtaining the time.  Your implementation may provide nonstandard ways
to obtain more accurate timings.  Try asking comp.sys.ibm.pc.
-- 
	-Colin
Technical Details
Message-ID: <22352@watdragon.waterloo.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watdragon!lion!ccplumb
References: <35363@grapevine.EBay.Sun.COM> <1990Mar21.195807.13318@IDA.ORG>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watdragon!lion!ccplumb
From: ccplumb@lion.waterloo.edu (Colin Plumb)
Newsgroups: comp.std.c
Subject: Re: Need help with defining time
Message-ID: <22352@watdragon.waterloo.edu>
Date: 22 Mar 90 02:50:49 GMT
References: <35363@grapevine.EBay.Sun.COM> <1990Mar21.195807.13318@IDA.ORG>
Sender: daemon@watdragon.waterloo.edu
Reply-To: ccplumb@lion.waterloo.edu (Colin Plumb)
Organization: U. of Waterloo, Ontario
Lines: 26