[M108 Migration] Print time as string 87/288287/3
authorv-saha <v.saha@samsung.com>
Tue, 14 Feb 2023 12:10:49 +0000 (17:40 +0530)
committerBot Blink <blinkbot@samsung.com>
Wed, 15 Feb 2023 07:53:06 +0000 (07:53 +0000)
Time stores int64_t. So, large numbers are printed as exponential
notation. This does not help in debugging. So, print time as string.

Reference: https://review.tizen.org/gerrit/c/282405

Change-Id: Ibce730ea00b6200e3ec7edad10c86164e97d39a7
Signed-off-by: v-saha <v.saha@samsung.com>
base/time/time.cc

index f6a8392..50ae8df 100644 (file)
@@ -131,7 +131,11 @@ TimeDelta TimeDelta::RoundToMultiple(TimeDelta interval) const {
 }
 
 std::ostream& operator<<(std::ostream& os, TimeDelta time_delta) {
+#if BUILDFLAG(IS_TIZEN)
+  return os << std::to_string(time_delta.InSecondsF()) << " s";
+#else
   return os << time_delta.InSecondsF() << " s";
+#endif
 }
 
 // Time -----------------------------------------------------------------------