summary refs log tree commit diff
path: root/bin/brot.c
diff options
context:
space:
mode:
Diffstat (limited to 'bin/brot.c')
-rw-r--r--bin/brot.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/bin/brot.c b/bin/brot.c
index b55e944e..44bd432d 100644
--- a/bin/brot.c
+++ b/bin/brot.c
@@ -22,8 +22,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <sys/time.h>
 #include <sysexits.h>
+#include <time.h>
 #include <unistd.h>
 
 #include "gfx/gfx.h"
@@ -76,15 +76,10 @@ static void color(uint32_t *buf, size_t width, size_t height) {
 
 static double frameTime;
 void draw(uint32_t *buf, size_t width, size_t height) {
-    struct timeval t0, t1;
-    gettimeofday(&t0, NULL);
-
+    clock_t t0 = clock();
     sample(buf, width, height);
     color(buf, width, height);
-
-    gettimeofday(&t1, NULL);
-    frameTime = (double)(t1.tv_sec - t0.tv_sec)
-        + ((double)t1.tv_usec - (double)t0.tv_usec) * 0.000001;
+    frameTime = (double)(clock() - t0) / (double)CLOCKS_PER_SEC;
 }
 
 static double translateStep = 1.0 / 128.0;
.c?h=3.8.1&id=fd56a8d74b9c1b9f7005fbc003d98f1253cd5eee&follow=1'>Import LibreSSL 3.4.0June McEnroe 2021-08-24Import LibreSSL 3.3.4June McEnroe 2021-05-25Bump version to 3.3.3p1 3.3.3p1June McEnroe 2021-05-25build: Add scripts to EXTRA_DISTJune McEnroe 2021-05-25import: Add missing scripts/wrap-compiler-for-flag-checkJune McEnroe 2021-05-08Import LibreSSL 3.3.3June McEnroe 2021-04-18build: Remove added x509_verify.3 links 3.3.2June McEnroe 2021-04-18tls: Use EC_KEY_set_ex_dataJune McEnroe 2021-04-18Import LibreSSL 3.3.2June McEnroe 2021-03-05Bump version to 3.3.1p1 3.3.1p1June McEnroe 2021-03-05build: Add OpenSSL includes to libcompatJune McEnroe 2020-12-15Import LibreSSL 3.3.1June McEnroe 2020-11-24Import LibreSSL 3.3.0June McEnroe 2020-10-22Import LibreSSL 3.2.2June McEnroe 2020-09-29Import LibreSSL 3.2.1June McEnroe 2020-09-29import: Add m4/ax_add_fortify_source.m4June McEnroe 2020-08-05build: Add README.7 to EXTRA_DIST 3.2.0June McEnroe 2020-08-03doc: Indicate that only OpenSSL 1.1.1b and newer workJune McEnroe