[BACK]Return to apps_posix.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / openssl

Diff for /src/usr.bin/openssl/apps_posix.c between version 1.4 and 1.5

version 1.4, 2017/12/05 15:02:06 version 1.5, 2018/07/13 18:36:56
Line 124 
Line 124 
 #include "apps.h"  #include "apps.h"
   
 double  double
 app_timer_real(int stop)  app_timer_real(int get)
 {  {
         static struct timespec start;          static struct timespec start;
         struct timespec elapsed, now;          struct timespec elapsed, now;
   
         clock_gettime(CLOCK_MONOTONIC, &now);          clock_gettime(CLOCK_MONOTONIC, &now);
         if (stop) {          if (get) {
                 timespecsub(&now, &start, &elapsed);                  timespecsub(&now, &start, &elapsed);
                 return elapsed.tv_sec + elapsed.tv_nsec / 1000000000.0;                  return elapsed.tv_sec + elapsed.tv_nsec / 1000000000.0;
         }          }
Line 139 
Line 139 
 }  }
   
 double  double
 app_timer_user(int stop)  app_timer_user(int get)
 {  {
         static struct timeval start;          static struct timeval start;
         struct timeval elapsed;          struct timeval elapsed;
         struct rusage now;          struct rusage now;
   
         getrusage(RUSAGE_SELF, &now);          getrusage(RUSAGE_SELF, &now);
         if (stop) {          if (get) {
                 timersub(&now.ru_utime, &start, &elapsed);                  timersub(&now.ru_utime, &start, &elapsed);
                 return elapsed.tv_sec + elapsed.tv_usec / 1000000.0;                  return elapsed.tv_sec + elapsed.tv_usec / 1000000.0;
         }          }

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5