diff options
author | Mats Wichmann <mats@linux.com> | 2021-02-08 20:24:06 (GMT) |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2021-02-08 20:24:06 (GMT) |
commit | fb7bb3f969698cbbcdb5af7c97f33c4529ba2e09 (patch) | |
tree | 761a6bc94e9bf285bfe1563dd44129ccc09b1ea7 /test/option | |
parent | 4dbccd6e784a4ea0c79972e79cef1b22ca3d6716 (diff) | |
download | SCons-fb7bb3f969698cbbcdb5af7c97f33c4529ba2e09.zip SCons-fb7bb3f969698cbbcdb5af7c97f33c4529ba2e09.tar.gz SCons-fb7bb3f969698cbbcdb5af7c97f33c4529ba2e09.tar.bz2 |
Add timing of sconsign write if --debug
A line is now emitted showing sconsign sync time if --debug=time
Some calls to time.time replaced with time.perf_counter, where the
objective was to time sections of code (i.e. where there wasn't
an actual need to get time-since-epoch) - Python recommends this
as getting the best-available timer.
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'test/option')
-rw-r--r-- | test/option/debug-time.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/option/debug-time.py b/test/option/debug-time.py index 7e95af3..19f1e7c 100644 --- a/test/option/debug-time.py +++ b/test/option/debug-time.py @@ -95,15 +95,15 @@ def get_command_time(stdout): test.write('pass.py', "pass\n") test.read(test.program) -start_time = time.time() +start_time = time.perf_counter() test.run(program=TestSCons.python, arguments=test.workpath('pass.py')) -overhead = time.time() - start_time +overhead = time.perf_counter() - start_time -start_time = time.time() +start_time = time.perf_counter() test.run(arguments = "-j1 --debug=time . SLEEP=0") -complete_time = time.time() - start_time +complete_time = time.perf_counter() - start_time @@ -132,7 +132,7 @@ warnings = [] if targets != expected_targets: failures.append("""\ -Scons reported the targets of timing information as %(targets)s, +Scons reported the targets of timing information as %(targets)s, but the actual targets should have been %(expected_targets)s. """ %locals()) |