Milliseconds
A duration containing an integral number of milliseconds.
@frozen struct Milliseconds
As this type is intended to witness UnixMillisecond
’s Duration
requirement, it does not necessarily have a physical meaning.
A duration containing an integral number of milliseconds.
@frozen struct Milliseconds
As this type is intended to witness UnixMillisecond
’s Duration
requirement, it does not necessarily have a physical meaning.
import UnixTime
This module provides portable duration and instant type definitions for working with machine time.
@frozen struct UnixMillisecond
A low-precision instant in time, measured in milliseconds since the Unix epoch.
associatedtype Duration : DurationProtocol
protocol AdditiveArithmetic : Equatable
A type with values that support addition and subtraction.
protocol BitwiseCopyable
protocol Comparable : Equatable
A type that can be compared using the relational operators <
, <=
, >=
, and >
.
protocol Copyable
A type whose values can be implicitly or explicitly copied.
protocol CustomStringConvertible
A type with a customized textual representation.
protocol DurationProtocol : AdditiveArithmetic, Comparable, Sendable
A type that defines a duration for a given InstantProtocol
type.
protocol Equatable
A type that can be compared for value equality.
protocol Escapable
protocol Hashable : Equatable
A type that can be hashed into a Hasher
to produce an integer hash value.
protocol QuantizedDuration : DurationProtocol, Hashable, RawRepresentable where Self.RawValue == Int64
protocol RawRepresentable<RawValue>
A type that can be converted to and from an associated raw value.
protocol Sendable
init(_ days: Days)
Creates a new duration by scaling the specified day-precision duration.
init(_ hours: Hours)
Creates a new duration by scaling the specified hour-precision duration.
init(_ minutes: Minutes)
Creates a new duration by scaling the specified minute-precision duration.
init(_ seconds: Seconds)
Creates a new duration by scaling the specified second-precision duration.
init(count: Int64)
Prefer the milliseconds(_:)
constructor when creating instances of this type.
init(truncating duration: Duration)
static var unit: DurationFormat.Unit { get }
static func milliseconds(_ milliseconds: Int64) -> Milliseconds
Creates a new duration with the specified number of milliseconds.
let count: Int64
The number of milliseconds in this duration.
init(rawValue: Int64)
static var max: Self { get }
static var zero: Self { get }
var description: String { get }
var hashValue: Int { get }
var rawValue: Int64 { get }
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.
static func * (a: Self, b: Int) -> Self
static func *= (lhs: inout Self, rhs: Int)
static func + (x: Self) -> Self
Returns the given number unchanged.
static func + (a: Self, b: Self) -> Self
static func += (lhs: inout Self, rhs: Self)
static func - (self: Self) -> Self
static func - (a: Self, b: Self) -> Self
static func -= (lhs: inout Self, rhs: Self)
static func ... (minimum: Self) -> PartialRangeFrom<Self>
Returns a partial range extending upward from a lower bound.
static func ... (maximum: Self) -> PartialRangeThrough<Self>
Returns a partial range up to, and including, its upper bound.
static func ... (minimum: Self, maximum: Self) -> ClosedRange<Self>
Returns a closed range that contains both of its bounds.
static func ..< (maximum: Self) -> PartialRangeUpTo<Self>
Returns a partial range up to, but not including, its upper bound.
static func ..< (minimum: Self, maximum: Self) -> Range<Self>
Returns a half-open range that contains its lower bound but not its upper bound.
static func / (a: Self, b: Self) -> Double
static func / (a: Self, b: Int) -> Self
static func /= (lhs: inout Self, rhs: Int)
static func < (a: Self, b: Self) -> Bool
static func <= (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether the value of the first argument is less than or equal to that of the second argument.
static func > (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether the value of the first argument is greater than that of the second argument.
static func >= (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether the value of the first argument is greater than or equal to that of the second argument.
func hash(into hasher: inout Hasher)