Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Fred Roy <froy@gr.osf.org>
Subject: Re: Re: good times(2|3)...
Date: Thu, 07 Mar 1996 12:40:26 +0100	[thread overview]
Message-ID: <65896917d2f8f71f41d5e616017ef3de.axp-list@archive.invalid> (raw)
In-Reply-To: <199603061638.JAA20839@koala.azstarnet.com>

Fred> PS (times()): Was it a missing 's' in the library sources
    Fred> you're working on ? I think so, because (at least with
    Fred> BLADE_0.3 libs) times() and time() return the same value!

  David> I'm not sure what you mean.  My current sources look OK and
  David> I know they work in GNU libc, but maybe I'm missing something
  David> since I haven't actually tried the new times() in libc-0.4x.

Ok, my english was somehow strange; let's retry in C:
/* --- */
#include <sys/types.h>

#include <time.h>
#include <sys/times.h>

#include <unistd.h>
#include <stdio.h>
main() {
        time_t  my_t;
        struct tms my_tms;
        long rt, rts;

        rt= (long)time(&my_t);
        rts= (long)times(&my_tms);
        printf("time()  returned %ld\n", (long)rt);
        printf("times() returned %ld\n", (long)rts);
        if ( rts == rt || rts == (rt + 1) )
                printf("!\n");
        else
                printf("I prefer that\n");

        /* misc. */
        printf("\n");
        printf("current time:        %ld\n",(long)my_t);  
        printf("current times: utime=%ld stime=%ld\n",
                        (long)my_tms.tms_utime,
                        (long)my_tms.tms_stime);
}
/* --- */

What I get with my (unmodifed) Linux/Alpha/BLADE_0.3 [unmodified:
e.g. without no updates of libraries] is:
time()  returned 826217813
times() returned 826217813
!

current time:        826217813
current times: utime=0 stime=4

What I get with my Slackware Linux/i486 is:
time()  returned 826196909
times() returned 553681879
I prefer that

current time:        826196909
current times: utime=0 stime=2

What do you prefer? (take of course this ubiquitous? question as you please!)
fred

PS: it's just for fun... I had very few problems with Linux/Alpha libs and
system headers: you've done a great job.

      reply	other threads:[~1996-03-07 11:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-03-06 16:38 good times(2|3); pre-compiled updates David Mosberger-Tang
1996-03-07 11:40 ` Fred Roy [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox