button: convert long-press time to std::chrono

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ia97dc229b43e32a30e4e57881628ab408896dcfb
diff --git a/src/button_handler.cpp b/src/button_handler.cpp
index ae9cc5d..aec5367 100644
--- a/src/button_handler.cpp
+++ b/src/button_handler.cpp
@@ -194,8 +194,6 @@
     std::string dbusIfaceName;
     std::string transitionName;
     std::variant<Host::Transition, Chassis::Transition> transition;
-    uint64_t durationMs =
-        std::chrono::duration_cast<std::chrono::milliseconds>(duration).count();
 
     size_t hostNumber = 0;
     auto isMultiHostSystem = isMultiHost();
@@ -211,7 +209,7 @@
     // ignore  power and reset button events if BMC is selected.
     if (isMultiHostSystem && (hostNumber == BMC_POSITION) &&
         (powerEventType != PowerEvent::powerReleased) &&
-        (durationMs <= LONG_PRESS_TIME_MS))
+        (duration <= LONG_PRESS_TIME_MS))
     {
         lg2::info(
             "handlePowerEvent : BMC selected on multi-host system. ignoring power and reset button events...");
@@ -222,7 +220,7 @@
     {
         case PowerEvent::powerReleased:
         {
-            if (durationMs <= LONG_PRESS_TIME_MS)
+            if (duration <= LONG_PRESS_TIME_MS)
             {
                 objPathName = HOST_STATE_OBJECT_NAME + hostNumStr;
                 dbusIfaceName = hostIface;