From: Joseph Tilahun <[email protected]>

The monotonic clock is preferable over the system clock when
computing the time elapsed.

Signed-off-by: Joseph Tilahun <[email protected]>
---
 scripts/oe-pkgdata-browser | 4 ++--
 scripts/runqemu            | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/scripts/oe-pkgdata-browser b/scripts/oe-pkgdata-browser
index c152c82b25..727803ba93 100755
--- a/scripts/oe-pkgdata-browser
+++ b/scripts/oe-pkgdata-browser
@@ -29,10 +29,10 @@ FileColumns = enum.IntEnum("FileColumns", {"Filename": 0, 
"Size": 1})
 import time
 def timeit(f):
     def timed(*args, **kw):
-        ts = time.time()
+        ts = time.monotonic()
         print ("func:%r calling" % f.__name__)
         result = f(*args, **kw)
-        te = time.time()
+        te = time.monotonic()
         print ('func:%r args:[%r, %r] took: %2.4f sec' % \
           (f.__name__, args, kw, te-ts))
         return result
diff --git a/scripts/runqemu b/scripts/runqemu
index 0e105a918b..d3c0b3fc38 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -1252,9 +1252,9 @@ to your build configuration.
         if self.snapshot and tmpfsdir:
             newrootfs = os.path.join(tmpfsdir, os.path.basename(self.rootfs)) 
+ "." + str(os.getpid())
             logger.info("Copying rootfs to %s" % newrootfs)
-            copy_start = time.time()
+            copy_start = time.monotonic()
             shutil.copyfile(self.rootfs, newrootfs)
-            logger.info("Copy done in %s seconds" % (time.time() - copy_start))
+            logger.info("Copy done in %s seconds" % (time.monotonic() - 
copy_start))
             self.rootfs = newrootfs
             # Don't need a second copy now!
             self.snapshot = False
-- 
2.25.1


-- 


________
This email and any attachments may contain Astranis confidential 
and/or proprietary information governed by a non-disclosure agreement, and 
are intended solely for the individual or entity specified by the message.
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#186342): 
https://lists.openembedded.org/g/openembedded-core/message/186342
Mute This Topic: https://lists.openembedded.org/mt/100808098/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to