OpenRoberta / robertalab-ev3dev

roberta lab connector for ev3dev
Apache License 2.0
17 stars 14 forks source link

Make timer methods in ev3.py work #50

Closed afgym-baeu closed 6 years ago

afgym-baeu commented 6 years ago

Old code did not work because for a type mismatch and wrong values. time.clock() referenced to a not well defined "processor time" which increases by approx 0.05 per second. Therefore time.time() should be used. A call to time.time() returns the system time as a float value in seconds. Documentation states that it may be very unprecise on some systems but it seems to work on the EV3.

codecov-io commented 6 years ago

Codecov Report

Merging #50 into develop will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop      #50   +/-   ##
========================================
  Coverage    73.87%   73.87%           
========================================
  Files            6        6           
  Lines          666      666           
========================================
  Hits           492      492           
  Misses         174      174

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a11d140...37f429f. Read the comment docs.

ensonic commented 6 years ago

Thanks! I rechecked the docs - time.clock() actually returns the time spend by the processor. This is quite confusing. In C clock_gettime() is the recommended way to measure time spans.