# What happened to Timestamp and what actually is Clock?

**URL:** <https://ziggit.dev/t/what-happened-to-timestamp-and-what-actually-is-clock/14310>\
**Category:** Explain\
**Tags:** language, standard-library\
**Created:** [February 13, 2026, 6:25pm UTC](https://ziggit.dev/t/what-happened-to-timestamp-and-what-actually-is-clock/14310 "2026-02-13T18:25:46Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![PauSolerValades](https://ziggit.dev/user_avatar/ziggit.dev/pausolervalades/32/7429_2.png) [@PauSolerValades](https://ziggit.dev/u/PauSolerValades)\
**Post date:** [February 13, 2026, 6:25pm UTC](https://ziggit.dev/t/what-happened-to-timestamp-and-what-actually-is-clock/14310/1 "2026-02-13T18:25:46Z")

</div>

Hello everyone!

I tried to reuse some of my 0.15 code for the 0.16-master to time a program and to create a file with the timestamp on it to be surprised at the function `std.time.timesamp()` not existing anymore. Checking the implementation of `Io` I’ve discovered that `Timestamp` is there, but there is also `Io.Clock`, which seems to be what Timestamp used to be?

I understand this behavior falling under the `Io` umbrella, but why `Clock` returns a timestamp?

```zig
    const real_clock = Io.Clock.real;
    const timestamp = Io.Clock.now(real_clock, init.io);

```

And what’s `Io.Timestamp` used for now? Will the `std.time` just contain time change constants as it does now? I am a little bit confused haha

Thank you 🙂

---

<div class="post-metadata">

**Author:** ![Southporter](https://ziggit.dev/user_avatar/ziggit.dev/southporter/32/2500_2.png) [@Southporter](https://ziggit.dev/u/Southporter)\
**Post date:** [February 13, 2026, 7:07pm UTC](https://ziggit.dev/t/what-happened-to-timestamp-and-what-actually-is-clock/14310/2 "2026-02-13T19:07:38Z")

</div>

A `Clock` defines where/how to get the timestamp. Different operating systems offer different kinds of clocks that have different behaviors. Essentially, it tells `Io` how to look up the timestamp.  
For example, `Clock.real` attempts to map to a real wall clock style time, however it is not strictly increasing as the OS internal clock can be adjusted by things like NTP or a cli tool. This can cause a weird behavior. So letting the user decide which `Clock` to use allows them to use the clock appropriate for their use case instead of whatever was chosen in `std.time.timestamp()`

---

<div class="post-metadata">

**Author:** ![invlpg](https://ziggit.dev/letter_avatar_proxy/v4/letter/i/13edae/32.png) [@invlpg](https://ziggit.dev/u/invlpg)\
**Post date:** [February 13, 2026, 7:07pm UTC](https://ziggit.dev/t/what-happened-to-timestamp-and-what-actually-is-clock/14310/3 "2026-02-13T19:07:50Z")

</div>

> [@PauSolerValades](#):
>
> `const timestamp = Io.Clock.now(real_clock, init.io);`

Not an answer to your full question, but this can be simplified to:

```zig
const timestamp = Io.Clock.now(.real, init.io);`
// or:
const timestamp = Io.Clock.real.now(init.io);

```

---

<div class="post-metadata">

**Author:** ![miagi](https://ziggit.dev/user_avatar/ziggit.dev/miagi/32/6745_2.png) [@miagi](https://ziggit.dev/u/miagi)\
**Post date:** [February 13, 2026, 8:53pm UTC](https://ziggit.dev/t/what-happened-to-timestamp-and-what-actually-is-clock/14310/4 "2026-02-13T20:53:01Z")

</div>

There is also `std.epoch` now in case you want to convert the timestamp into regular human format. This is my [timestamp.zig](https://codeberg.org/Jmarkovic/sortcp/src/branch/0.16/src/timestamp.zig) what is currently working on 0.16 latest. It is essentially @ehrktia’s [showcase](https://ziggit.dev/t/simple-timestamp-lib-to-record-timestamp-in-logs-with-millisecond-precision/13658/18) that I saw and refactored a bit.

---

<div class="post-metadata">

**Author:** ![PauSolerValades](https://ziggit.dev/user_avatar/ziggit.dev/pausolervalades/32/7429_2.png) [@PauSolerValades](https://ziggit.dev/u/PauSolerValades)\
**Post date:** [February 14, 2026, 1:04am UTC](https://ziggit.dev/t/what-happened-to-timestamp-and-what-actually-is-clock/14310/5 "2026-02-14T01:04:00Z")

</div>

I could never even fathom that different OS could have different implementations of timestamps, or even that the timer from the timestamp could be a different implementation strategy! Given that fact, it makes sense to actually want to separate the result (timestamp) from its generator (clock). Thank you!

---

<div class="post-metadata">

**Author:** ![PauSolerValades](https://ziggit.dev/user_avatar/ziggit.dev/pausolervalades/32/7429_2.png) [@PauSolerValades](https://ziggit.dev/u/PauSolerValades)\
**Post date:** [February 14, 2026, 1:06am UTC](https://ziggit.dev/t/what-happened-to-timestamp-and-what-actually-is-clock/14310/6 "2026-02-14T01:06:34Z")

</div>

So the old `Timer` is now just several concatenations and substractions of `Io.Clock`? Like, we have kinda lost that or there is a combination of clocks which allows me to measure time just fine? Thank you!

---

<div class="post-metadata">

**Author:** ![FObersteiner](https://ziggit.dev/user_avatar/ziggit.dev/fobersteiner/32/1177_2.png) [@FObersteiner](https://ziggit.dev/u/FObersteiner)\
**Post date:** [February 16, 2026, 8:41am UTC](https://ziggit.dev/t/what-happened-to-timestamp-and-what-actually-is-clock/14310/7 "2026-02-16T08:41:55Z")

</div>

the old Timer was using a monotonic clock under the hood (CLOCK\_MONOTONIC on Linux), so I guess with Io.Clock I’d use `.awake` and create my own “Timer”. `.cpu_process` and `.cpu_thread` also look interesting, if you’re interested in the “compute time spent” and not so much time spent in a physical sense.

---

<div class="post-metadata">

**Author:** ![miagi](https://ziggit.dev/user_avatar/ziggit.dev/miagi/32/6745_2.png) [@miagi](https://ziggit.dev/u/miagi)\
**Post date:** [February 17, 2026, 11:49am UTC](https://ziggit.dev/t/what-happened-to-timestamp-and-what-actually-is-clock/14310/8 "2026-02-17T11:49:07Z")

</div>

There is now `Duration` struct, `untilNow()` and `durationFromNow()` functions that all can serve in the purpose of a basic timer.
