Skip to content

Commit

Permalink
Add sleep method (#628)
Browse files Browse the repository at this point in the history
  • Loading branch information
cstjean authored Apr 1, 2023
1 parent 49623e0 commit 9af5ee7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Unitful.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import Base: length, float, last, one, oneunit, zero, range
import Base: getindex, eltype, step, last, first, frexp
import Base: Integer, Rational, typemin, typemax
import Base: steprange_last, unsigned
import Base: sleep
@static if VERSION v"1.7.0-DEV.119"
import Base: isunordered
end
Expand Down
2 changes: 2 additions & 0 deletions src/dates.jl
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,5 @@ end

isapprox(x::AbstractArray{Dates.CompoundPeriod}, y::AbstractArray{<:AbstractQuantity};
kwargs...) = isapprox(y, x; kwargs...)

sleep(x::AbstractQuantity) = sleep(ustrip(s, x))
2 changes: 2 additions & 0 deletions test/dates.jl
Original file line number Diff line number Diff line change
Expand Up @@ -783,4 +783,6 @@
@test_throws ErrorException promote(1u"m", Second(1))
@test_throws ErrorException promote(Day(1), 3u"T")
end

sleep(10u"ms") # not tested explicitly, because sleep doesn't come with guarantees
end

0 comments on commit 9af5ee7

Please sign in to comment.