Path: utzoo!utgpu!water!watmath!clyde!rutgers!mcnc!decvax!decwrl!sun!pitstop!sundc!seismo!uunet!mcvax!ukc!its63b!aiva!richard From: richard@aiva.ed.ac.uk (Richard Tobin) Newsgroups: comp.lang.c Subject: Re: C machine Keywords: printf, ptrdiff_t, time_t Message-ID: <245@aiva.ed.ac.uk> Date: 30 Jan 88 19:47:01 GMT References: <461@auvax.UUCP> <28700025@ccvaxa> <7159@brl-smoke.ARPA> <1131@jenny.cl.cam.ac.uk> Reply-To: richard@uk.ac.ed.aiva (Richard Tobin,E26 SB x206E,,4477106) Organization: Bannerman's Bar, Cowgate, Edinburgh Lines: 24 In article <1131@jenny.cl.cam.ac.uk> am@cl.cam.ac.uk (Alan Mycroft) writes: >Even more problematic: has anyone on the ANSI committee tried >writing a STRICTLY CONFORMING program which accurately prints cpu time >(a la clock()) to a file (say in centi-secs or to 2 decimal places)? >Perhaps printf("%t", (time_t)...)? >The trouble is that time_t may be either integral or floating. Hmmm... I haven't got a standard handy, so maybe I'm missing something, but how about: int time_is_floating; time_t t; time_is_floating = (t = 1.5, t > 1); if(time_is_floating) .... Ok, so it's a hack. -- Richard Tobin, JANET: R.Tobin@uk.ac.ed AI Applications Institute, ARPA: R.Tobin%uk.ac.ed@nss.cs.ucl.ac.uk Edinburgh University. UUCP: ...!ukc!ed.ac.uk!R.Tobin