summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorSultan Al Isaiee <sultan@foxoman.net>2023-03-04 18:53:57 +0400
committerGitHub <noreply@github.com>2023-03-04 15:53:57 +0100
commit04a494f8cfe960104150dd288d587d7e2cf3bd8a (patch)
tree8b6ceb3c5d3ffa0522f42e2007dd7fb34ac48d86 /lib
parentd950e5f3a8efe0c3be8e773cce4a89807833ffea (diff)
downloadNim-04a494f8cfe960104150dd288d587d7e2cf3bd8a.tar.gz
Add warning to specify timeout value in milliseconds, Fix #21449 (#21471)
a warning message been added to the documentation to remind users that the timeout parameter is expressed in milliseconds, not seconds. to help prevent confusion and unexpected behaviours.
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/osproc.nim4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim
index 4cdd98c0d..915337f12 100644
--- a/lib/pure/osproc.nim
+++ b/lib/pure/osproc.nim
@@ -220,6 +220,10 @@ proc waitForExit*(p: Process, timeout: int = -1): int {.rtl,
   ##
   ## On posix, if the process has exited because of a signal, 128 + signal
   ## number will be returned.
+  ##
+  ## .. warning:: When working with `timeout` parameters, remember that the value is 
+  ##   typically expressed in milliseconds, and ensure that the correct unit of time
+  ##   is used to avoid unexpected behavior.
 
 proc peekExitCode*(p: Process): int {.rtl, extern: "nosp$1", raises: [OSError], tags: [].}
   ## Return `-1` if the process is still running. Otherwise the process' exit code.