Skip to content

Provide access to subsecond nanos in the public interface of Duration. #154

@tylerreisinger

Description

@tylerreisinger

The way the Duration struct is implemented, if there are more total nanoseconds represented than i64::MAX, it is impossible to see greater than millisecond precision on the outside despite that information being stored. It would be useful to have a method similar to std::time::Duration::subsec_nanos which can return only the number of nanoseconds past the nearest second.

Additionally, for interfacing with chrono, it would be useful to have a constructor to create a Duration from a number of whole seconds plus the additional nanoseconds similar to std::time::Duration::new to efficiently construct Duration objects with full precision.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions