freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2] GSoC-2023-Ahmet 267f1914d: working fine


From: Werner Lemberg
Subject: [freetype2] GSoC-2023-Ahmet 267f1914d: working fine
Date: Wed, 30 Aug 2023 11:15:31 -0400 (EDT)

branch: GSoC-2023-Ahmet
commit 267f1914d67ca1095633ab3ecadf496246fedc5d
Author: goksu <25721443+goeksu@users.noreply.github.com>
Commit: goksu <25721443+goeksu@users.noreply.github.com>

    working fine
---
 src/tools/ftbench/ftbench.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/src/tools/ftbench/ftbench.c b/src/tools/ftbench/ftbench.c
index 95b6d5da2..697c62222 100644
--- a/src/tools/ftbench/ftbench.c
+++ b/src/tools/ftbench/ftbench.c
@@ -243,7 +243,7 @@
 #ifdef _POSIX_CPUTIME
     clock_gettime( CLOCK_PROCESS_CPUTIME_ID, &tv );
 #else
-    clock_gettime( CLOCK_REALTIME, &tv );
+    clock_gettime( CLOCK_MONOTONIC, &tv );
 #endif /* _POSIX_CPUTIME */
 
     return 1E6 * (double)tv.tv_sec + 1E-3 * (double)tv.tv_nsec;
@@ -276,14 +276,17 @@ static void benchmark(FT_Face face, btest_t* test, int 
max_iter, double max_time
     int NUM_CHUNKS = max_iter / CHUNK_SIZE;
     double medians[NUM_CHUNKS];
 
-    // Cache and warmup
+    // Cache
     if (test->cache_first) { 
-      TIMER_START(&timer);
-      for(int i = 0; i<1+warmup; i++)    
-        test->bench(face, test->user_data);  
-      TIMER_STOP(&timer);  
+      test->bench(face, test->user_data);  
     }
-    
+
+    // Warmup
+    TIMER_START(&timer);
+    for(int i = 0; i<warmup; i++)    
+        test->bench(face, test->user_data);  
+    TIMER_STOP(&timer);
+
     printf("  %-25s ", test->title);
     fflush(stdout);
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]