Skip to content

Commit 331634f

Browse files
authored
Measure install time with monotonic clock instead of system clock (archlinux#4198)
Using time.time() can be inaccurate if the system clock gets updated in between calls.
1 parent 173c64c commit 331634f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

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)