mirror of
https://github.com/ziglang/zig.git
synced 2024-11-30 00:52:52 +00:00
e3424332d3
* `doc/langref` formatting * upgrade `.{ .path = "..." }` to `b.path("...")` * avoid using arguments named `self` * make `Build.Step.Id` usage more consistent * add `Build.pathResolve` * use `pathJoin` and `pathResolve` everywhere * make sure `Build.LazyPath.getPath2` returns an absolute path
20 lines
666 B
Zig
20 lines
666 B
Zig
/// A structure for storing a timestamp, with nanosecond precision (this is a
|
|
/// multiline doc comment).
|
|
const Timestamp = struct {
|
|
/// The number of seconds since the epoch (this is also a doc comment).
|
|
seconds: i64, // signed so we can represent pre-1970 (not a doc comment)
|
|
/// The number of nanoseconds past the second (doc comment again).
|
|
nanos: u32,
|
|
|
|
/// Returns a `Timestamp` struct representing the Unix epoch; that is, the
|
|
/// moment of 1970 Jan 1 00:00:00 UTC (this is a doc comment too).
|
|
pub fn unixEpoch() Timestamp {
|
|
return Timestamp{
|
|
.seconds = 0,
|
|
.nanos = 0,
|
|
};
|
|
}
|
|
};
|
|
|
|
// syntax
|