Skip to content

Time should be represented internally by std::chrono types #83

Open

Description

Problem
Right now, time points and durations are represented by a pletora of types (to name a few):
int, unsigned, uint64_t, int64_t

This is undesirable, as not only is it inconsistent, but C++11 introduces the chrono header, which provides both:
std::chrono::time_point - A representation of a point in time.
std::chrono::duration - A representation of the span between two points in time.

Proposed Solution
Standardize on std::chrono types for representing durations and points in time. Use these types everywhere possible (it may not be doable in the C-API). Serialize these values to the appropriate CS types during serialization, not before.

To start, the PAL methods which return the current time should be updated to return a std::chrono type. This way, the epoch can be controlled from a central point and differing OS epochs (.NET, Win32, UNIX, etc.) can be abstracted away from the caller.

Non Goals
Will not address time representations in the public API surface of the SDK, as that's a bigger conversation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

designArchitecture and designenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions