From 4f1a8cdd3b911228f4e46d19e60c8c74071806bc Mon Sep 17 00:00:00 2001 From: Katharine Hyatt Date: Thu, 28 Mar 2019 09:39:27 -0400 Subject: [PATCH 1/2] doc systemsleep --- base/libc.jl | 6 ++++++ doc/src/base/libc.md | 1 + 2 files changed, 7 insertions(+) diff --git a/base/libc.jl b/base/libc.jl index e78b5a1d13c92..514c700480668 100644 --- a/base/libc.jl +++ b/base/libc.jl @@ -122,6 +122,12 @@ elseif Sys.iswindows() else error("systemsleep undefined for this OS") end +""" + systemsleep(s::Real) + +Suspends execution for `s` seconds. +""" +systemsleep struct TimeVal sec::Int64 diff --git a/doc/src/base/libc.md b/doc/src/base/libc.md index 65bdb3da10d28..0af1b74a79a71 100644 --- a/doc/src/base/libc.md +++ b/doc/src/base/libc.md @@ -14,4 +14,5 @@ Base.Libc.strftime Base.Libc.strptime Base.Libc.TmStruct Base.Libc.flush_cstdio +Base.Libc.systemsleep ``` From 0ade63d1985cb4f4c1deef46bb620b512ec2ec21 Mon Sep 17 00:00:00 2001 From: Stefan Karpinski Date: Thu, 28 Mar 2019 12:50:29 -0400 Subject: [PATCH 2/2] Update base/libc.jl Co-Authored-By: kshyatt --- base/libc.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/base/libc.jl b/base/libc.jl index 514c700480668..1ffe8a92aabfb 100644 --- a/base/libc.jl +++ b/base/libc.jl @@ -126,6 +126,10 @@ end systemsleep(s::Real) Suspends execution for `s` seconds. +This function does not yield to Julia's scheduler and therefore blocks +the Julia thread that it is running on for the duration of the sleep time. + +See also: [`sleep`](@ref) """ systemsleep