From cd5dabf464936029a28664999fda1e60713f2829 Mon Sep 17 00:00:00 2001 From: paul-szczepanek-arm <33840200+paul-szczepanek-arm@users.noreply.github.com> Date: Thu, 22 Nov 2018 14:01:28 +0000 Subject: [PATCH] duration added valueInMs --- features/FEATURE_BLE/ble/common/Duration.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/features/FEATURE_BLE/ble/common/Duration.h b/features/FEATURE_BLE/ble/common/Duration.h index 0bd011cb4b..83b138d9f4 100644 --- a/features/FEATURE_BLE/ble/common/Duration.h +++ b/features/FEATURE_BLE/ble/common/Duration.h @@ -151,6 +151,15 @@ struct Duration { return duration; } + /** + * Return the duration in milliseconds. + * + * @return The duration in milliseconds. + */ + uint32_t valueInMs() const { + return ((uint32_t)duration * TB) / 1000; + } + /** * The time base. */