MOO-cows Mailing List Archive


Re: time() built-in

static package
bf_us_time(Var arglist, Byte next, void *vdata, Objid progr)
    Var r;
    struct timevel *tv = (struct timeval *)alloc_data(sizeof(struct timeval));
    struct timezone *tz = 0;

    gettimeofday(tv, tz);

    r = new_float(((double)tv->tv_sec) + ((double)tv->tv_usec / 1000000));
    return make_var_pack(r);

and in register_extensions...
     register_function("us_time", 0, 0, bf_us_time);

In answer to your second question, send mail to with the single line message "subscribe MOO-Cows".

   Brian Buchanan
-= ArchWizard of Digital Wasteland MOO ( 8888) =-


Home | Subject Index | Thread Index