Contents

init(attoseconds:)

Construct a Duration from the given number of attoseconds.

Declaration

init(attoseconds: Int128)

Parameters

  • attoseconds:

    The total duration expressed in attoseconds.

Discussion

This directly constructs a Duration from the given number of attoseconds.

let d = Duration(attoseconds: 1_000_000_000_000_000_000)
print(d) // 1.0 seconds