From: Bodo Moeller <[EMAIL PROTECTED]>

moeller> If you want elapsed real time ('openssl speed -elapsed'), you need
moeller> times(), which measures in clock ticks and not in CLOCKS_PER_SEC.

-elapsed measures clock time (using ftime or gettimeofday, depending
on what's available).  times() gives back the following information:

       struct  tms  {
                    clock_t tms_utime;  /* user time */
                    clock_t tms_stime;  /* system time */
                    clock_t tms_cutime; /* user time of children */
                    clock_t tms_cstime; /* system time of children */
                    };

That doesn't give real time, does it?

moeller> It seems the preferred way to get the correct number of clock ticks
moeller> per second is to use sysconf(_SC_CLK_TCK) and not the CLK_TCK macro.
moeller> So maybe changing the HZ definition in apps/speed.c as follows
moeller> might help:
moeller> 
moeller> #include OPENSSL_UNISTD
moeller> #ifndef HZ
moeller> #  ifdef _SC_CLK_TCK
moeller> #    define HZ (sysconf(_SC_CLK_TCK))
moeller> #  else
moeller>    /* ... */
moeller> #endif

I just did that, and that was the perfect solution.  Thanks!

-- 
Richard Levitte   \ Spannv�gen 38, II \ [EMAIL PROTECTED]
Redakteur@Stacken  \ S-168 35  BROMMA  \ T: +46-8-26 52 47
                    \      SWEDEN       \ or +46-733-72 88 11
Procurator Odiosus Ex Infernis                -- [EMAIL PROTECTED]
Member of the OpenSSL development team: http://www.openssl.org/
Software Engineer, GemPlus:             http://www.gemplus.com/

Unsolicited commercial email is subject to an archival fee of $400.
See <http://www.stacken.kth.se/~levitte/mail/> for more info.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to