~berfr/berfr.me

7e40e939c4f5ea3bb104e6a053016f43beffe8d9 — berfr 4 months ago bf0e080 master 20-05-01-08-25
Add sentence in execution-time post
1 files changed, 3 insertions(+), 1 deletions(-)

M content/posts/execution-time.md
M content/posts/execution-time.md => content/posts/execution-time.md +3 -1
@@ 64,7 64,9 @@ operating system to return when the amount of time is elapsed.
The actual CPU time can be seen in the values returned by the [`time`] command.
The `user` and `sys` parts is the time that was taken for running code in
user-mode and in kernel-mode respectively. The first program spent all the time
running code whereas the second spent almost no time running code.
running code whereas the second spent almost no time running code. While they
have the same behavior, it could be argued that the second script is better
since it leaves CPU time for the OS to perform more important tasks.

[`time.sleep`]: https://github.com/python/cpython/blob/62183b8d6d49e59c6a98bbdaa65b7ea1415abb7f/Modules/timemodule.c#L326
[`pysleep`]: https://github.com/python/cpython/blob/62183b8d6d49e59c6a98bbdaa65b7ea1415abb7f/Modules/timemodule.c#L1859