Dmitry Eremin-Solenikov(lumag) replied on github web page:

test/validation/api/time/time.c
@@ -436,12 +436,12 @@ static void time_test_accuracy(time_cb time_cur, 
time_from_ns_cb time_from_ns)
                wait = odp_time_sum(wait, sec);
        }
 
+       c2 = time(NULL);
        t2 = time_cur();
-       c2 = clock();
 
        diff  = odp_time_diff(t2, t1);
        sec_t = ((double)odp_time_to_ns(diff)) / ODP_TIME_SEC_IN_NS;
-       sec_c = ((double)(c2 - c1)) / CLOCKS_PER_SEC;
+       sec_c = ((double)(c2 - c1));


Comment:
I will change that to `gettimeofday()`. 

> Petri Savolainen(psavol) wrote:
> time_t is an integer value of seconds, right? sec_c is the reference that we 
> compare ODP time measurement against. Test passes if ODP measures within +-5% 
> the reference. Usage of time() change the reference to be very coarse grained 
> (e.g. 4, 5 or 6 sec), while the real time spent on the wait loop may be e.g. 
> 5.453 sec and ODP may measure 5.461 sec and the time() measures just 5.0 sec. 
> So, test result would be "fail" (5.461 vs 5.0) although ODP measurement error 
> was only+0.14% (5.461 vs 5.453).


>> Dmitry Eremin-Solenikov(lumag) wrote:
>> Well, no. Please recheck. I will update description to mention that is means 
>> static linking of libodp-linux into examples.


>>> muvarov wrote
>>> At his time if --disable-static-link is specified then linking is static. 
>>> If it's not specified that it's dynamic. I'm looking on odp_generator.


https://github.com/Linaro/odp/pull/377#discussion_r159528690
updated_at 2018-01-03 21:54:54

Reply via email to