Eu time() in C?

new topic     » topic index » view thread      » older message » newer message

Hi,
I am rewritting some Euphoria programs to C to see how
much the speed differs. In Euphoria, I measure the timings
with time(), but how can get exact same timings in C?
(I probably need some reference for standard libraries,
figuring it out from header files is not always ok.)

I have some forms, which one is correct?
(I have Borland 5.5)

#include <time.h>
unsigned long int time_(void)
/* which one is Euphoria time() ? */

{
    return clock()/CLOCKS_PER_SEC;
};

/* or */

{
    time_t *timer; /* for what? */
    return time(&timer);
};

/* this one crashes */

{
    struct tm *tblock;
    tblock = asctime(&tblock);
    return tblock->tm_sec;
};

Regards,
      Martin Stachon

martin.stachon at tiscali.cz
http://www.webpark.cz/stachon

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu