Initializerswift-nio 2.80.0NIOCore
init(_:)
TimeAmount+Duration.swift:20- iOS
- 16+
- macOS
- 13+
- tvOS
- 16+
- watchOS
- 9+
init(_ duration: Swift.Duration)
init(_ duration: Swift.Duration)
import NIOCore
The core abstractions that make up SwiftNIO.
struct TimeAmount
Represents a time interval.
@frozen struct Duration
A representation of high precision time.
init(_ userProvidedString: String) throws
Creates a TimeAmount from a string representation with an optional default unit.
static var zero: TimeAmount { get }
The zero value for TimeAmount
.
static func hours(_ amount: Int64) -> TimeAmount
Creates a new TimeAmount
for the given amount of hours.
static func microseconds(_ amount: Int64) -> TimeAmount
Creates a new TimeAmount
for the given amount of microseconds.
static func milliseconds(_ amount: Int64) -> TimeAmount
Creates a new TimeAmount
for the given amount of milliseconds.
static func minutes(_ amount: Int64) -> TimeAmount
Creates a new TimeAmount
for the given amount of minutes.
static func nanoseconds(_ amount: Int64) -> TimeAmount
Creates a new TimeAmount
for the given amount of nanoseconds.
static func seconds(_ amount: Int64) -> TimeAmount
Creates a new TimeAmount
for the given amount of seconds.
var description: String { get }
Returns a human-readable string representation of the time amount using the most appropriate unit
let nanoseconds: Int64
The nanoseconds representation of the TimeAmount
.
static func * <T>(lhs: TimeAmount, rhs: T) -> TimeAmount where T : BinaryInteger
static func * <T>(lhs: T, rhs: TimeAmount) -> TimeAmount where T : BinaryInteger
static func + (lhs: TimeAmount, rhs: TimeAmount) -> TimeAmount
static func += (lhs: inout TimeAmount, rhs: TimeAmount)
static func - (lhs: TimeAmount, rhs: TimeAmount) -> TimeAmount
static func -= (lhs: inout TimeAmount, rhs: TimeAmount)
static func < (lhs: TimeAmount, rhs: TimeAmount) -> Bool
typealias Value = Int64