chromium/mojo/public/mojom/base/time.mojom

// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

module mojo_base.mojom;

[Stable]
struct Time {
  // The internal value is expressed in terms of microseconds since a fixed but
  // intentionally unspecified epoch.
  int64 internal_value;
};

[Stable]
struct JSTime {
  // This type is used to map a Javascript Date object (based on Unix epoch)
  // to a C++ base::Time (based on Windows epoch). The value `msec` is
  // expressed in terms of milliseconds since the Unix epoch. From Javascript,
  // `msec` should be set via functions that return the timestamp, i.e.
  // `Date.now()`, `Date.parse()`, or `valueOf()`.
  double msec;
};

[Stable]
struct TimeDelta {
  int64 microseconds;
};

[Stable]
struct TimeTicks {
  // The internal value is expressed in terms of microseconds since a fixed but
  // intentionally unspecified epoch.
  int64 internal_value;
};