Skip to content

Commit 3663779

Browse files
committed
Measure install time with monotonic clock instead of system clock
Using time.time() can be inaccurate if the system clock gets updated in between calls.
1 parent 47a4caf commit 3663779

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

archinstall/scripts/guided.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def perform_installation(
5757
Only requirement is that the block devices are
5858
formatted and setup prior to entering this function.
5959
"""
60-
start_time = time.time()
60+
start_time = time.monotonic()
6161
info('Starting installation...')
6262

6363
config = arch_config_handler.config
@@ -169,7 +169,7 @@ def perform_installation(
169169
debug(f'Disk states after installing:\n{disk_layouts()}')
170170

171171
if not arch_config_handler.args.silent:
172-
elapsed_time = time.time() - start_time
172+
elapsed_time = time.monotonic() - start_time
173173
action = select_post_installation(elapsed_time)
174174

175175
match action:

0 commit comments

Comments
 (0)