diff mbox series

[API-NEXT,v1,2/3] linux-gen: time: implement odp_time_diff_ns

Message ID 1511528406-25262-3-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [API-NEXT,v1,1/3] api: time: time difference in nsec | expand

Commit Message

Github ODP bot Nov. 24, 2017, 1 p.m. UTC
From: Petri Savolainen <petri.savolainen@linaro.org>


Implemented the new diff in nsec function.

Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>

---
/** Email created from pull request 310 (psavol:next-time-convert)
 ** https://github.com/Linaro/odp/pull/310
 ** Patch: https://github.com/Linaro/odp/pull/310.patch
 ** Base sha: b95e7d08043ba45d12635c5afaa3fbf3a07ecc90
 ** Merge commit sha: 7700d0dab4af4db47973c2a88e5a6d6765bf979e
 **/
 platform/linux-generic/odp_time.c | 9 +++++++++
 1 file changed, 9 insertions(+)
diff mbox series

Patch

diff --git a/platform/linux-generic/odp_time.c b/platform/linux-generic/odp_time.c
index 0df4682c3..04fedf5fa 100644
--- a/platform/linux-generic/odp_time.c
+++ b/platform/linux-generic/odp_time.c
@@ -228,6 +228,15 @@  odp_time_t odp_time_diff(odp_time_t t2, odp_time_t t1)
 	return time;
 }
 
+uint64_t odp_time_diff_ns(odp_time_t t2, odp_time_t t1)
+{
+	odp_time_t time;
+
+	time.u64 = t2.u64 - t1.u64;
+
+	return time_to_ns(time);
+}
+
 uint64_t odp_time_to_ns(odp_time_t time)
 {
 	return time_to_ns(time);