+

On 19.08.15 17:49, Ivan Khoronzhuk wrote:


On 19.08.15 17:12, Savolainen, Petri (Nokia - FI/Espoo) wrote:
Hi,

As I mentioned in the call, I'd like to avoid confusion between time and timer (timer 
tick). In minimum, the API documentation should not refer to "timer". Also 
could term 'tick' be removed altogether and just use 'time'?

Something like this:

uint64_t odp_time(void);
uint64_t odp_time_diff(uint64_t t1, uint64_t t2);
uint64_t odp_time_to_ns(uint64_t time);
uint64_t odp_time_from_ns(uint64_t ns);

-Petri

Sorry I've unintentionally missed this call.

It's confusing only at first glance. I'm used to this already.
Even don't know, it seems to be reasonable, but any way we
have similar function odp_time_to_ns. And avoiding word tick
makes the functions a little strange, like you take time, by default
it is in ticks, but time is so general word... name odp_time_to_ns
sounds like you convert time to ns, how it can be?

But if it can make life easier I have no objection, I don't know conclusion
about this on the call but if Maxim, Stuart and others are OK with it I
can change it.


Maybe
odp_tick()
odp_tick_diff()
odp_tick_to_ns()
odp_tick_from_ns()
....




diff --git a/include/odp/api/time.h b/include/odp/api/time.h
index b0072fc..b48dcae 100644
--- a/include/odp/api/time.h
+++ b/include/odp/api/time.h
@@ -30,11 +30,11 @@ extern "C" {


  /**
- * Current time in CPU cycles
+ * Current time in ticks of best hi-resolution timer available
   *
- * @return Current time in CPU cycles
+ * @return Current time in timer ticks
   */
-uint64_t odp_time_cycles(void);
+uint64_t odp_time_tick(void);


  /**
@@ -43,29 +43,29 @@ uint64_t odp_time_cycles(void);
   * @param t1    First time stamp
   * @param t2    Second time stamp
   *
- * @return Difference of time stamps in CPU cycles
+ * @return Difference of time stamps in timer ticks
   */
-uint64_t odp_time_diff_cycles(uint64_t t1, uint64_t t2);
+uint64_t odp_time_ticks_diff(uint64_t t1, uint64_t t2);


  /**
- * Convert CPU cycles to nanoseconds
+ * Convert timer ticks to nanoseconds
   *
- * @param cycles  Time in CPU cycles
+ * @param ticks  Time in timer ticks
   *
   * @return Time in nanoseconds
   */
-uint64_t odp_time_cycles_to_ns(uint64_t cycles);
+uint64_t odp_time_tick_to_ns(uint64_t ticks);


  /**
- * Convert nanoseconds to CPU cycles
+ * Convert nanoseconds to ticks of best hi-resolution timer available
   *
   * @param ns      Time in nanoseconds
   *
- * @return Time in CPU cycles
+ * @return Time in timer ticks
   */
-uint64_t odp_time_ns_to_cycles(uint64_t ns);
+uint64_t odp_time_ns_to_tick(uint64_t ns);


--
Regards,
Ivan Khoronzhuk
_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to