Much more apt than the current operation names.
Names suggested by jca@ ages ago.
ok jca, jsing
-/* $OpenBSD: apps.h,v 1.20 2017/12/05 15:02:06 jca Exp $ */
+/* $OpenBSD: apps.h,v 1.21 2018/07/13 18:36:56 cheloha Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
int app_isdir(const char *);
-#define TM_START 0
-#define TM_STOP 1
-double app_timer_real(int stop);
-double app_timer_user(int stop);
+#define TM_RESET 0
+#define TM_GET 1
+double app_timer_real(int);
+double app_timer_user(int);
#define OPENSSL_NO_SSL_INTERN
#include "apps.h"
double
-app_timer_real(int stop)
+app_timer_real(int get)
{
static struct timespec start;
struct timespec elapsed, now;
clock_gettime(CLOCK_MONOTONIC, &now);
- if (stop) {
+ if (get) {
timespecsub(&now, &start, &elapsed);
return elapsed.tv_sec + elapsed.tv_nsec / 1000000000.0;
}
}
double
-app_timer_user(int stop)
+app_timer_user(int get)
{
static struct timeval start;
struct timeval elapsed;
struct rusage now;
getrusage(RUSAGE_SELF, &now);
- if (stop) {
+ if (get) {
timersub(&now.ru_utime, &start, &elapsed);
return elapsed.tv_sec + elapsed.tv_usec / 1000000.0;
}
-/* $OpenBSD: s_time.c,v 1.23 2018/02/07 05:47:55 jsing Exp $ */
+/* $OpenBSD: s_time.c,v 1.24 2018/07/13 18:36:56 cheloha Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
/***********************************************************************
* TIME - time functions
*/
-#define START 0
-#define STOP 1
+#define START TM_RESET
+#define STOP TM_GET
static double
tm_Time_F(int op)
-/* $OpenBSD: speed.c,v 1.22 2018/02/07 05:47:55 jsing Exp $ */
+/* $OpenBSD: speed.c,v 1.23 2018/07/13 18:36:56 cheloha Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
run = 0;
}
-#define START 0
-#define STOP 1
+#define START TM_RESET
+#define STOP TM_GET
static double