Skip to content

Commit 9af5ee7

Browse files
authored
Add sleep method (#628)
1 parent 49623e0 commit 9af5ee7

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

src/Unitful.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import Base: length, float, last, one, oneunit, zero, range
1616
import Base: getindex, eltype, step, last, first, frexp
1717
import Base: Integer, Rational, typemin, typemax
1818
import Base: steprange_last, unsigned
19+
import Base: sleep
1920
@static if VERSION v"1.7.0-DEV.119"
2021
import Base: isunordered
2122
end

src/dates.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,3 +186,5 @@ end
186186

187187
isapprox(x::AbstractArray{Dates.CompoundPeriod}, y::AbstractArray{<:AbstractQuantity};
188188
kwargs...) = isapprox(y, x; kwargs...)
189+
190+
sleep(x::AbstractQuantity) = sleep(ustrip(s, x))

test/dates.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,4 +783,6 @@
783783
@test_throws ErrorException promote(1u"m", Second(1))
784784
@test_throws ErrorException promote(Day(1), 3u"T")
785785
end
786+
787+
sleep(10u"ms") # not tested explicitly, because sleep doesn't come with guarantees
786788
end

0 commit comments

Comments
 (0)