# std.time.Timer.lap: only read system time once \(\#4533\) · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/907c5589ae20d1b2a73acf26c9d67139dfe3bfb9)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 907c5589ae20d1b2a73acf26c9d67139dfe3bfb9

Requested commit: 907c5589ae20d1b2a73acf26c9d67139dfe3bfb9

Commit: 907c5589ae20d1b2a73acf26c9d67139dfe3bfb9

Tree: b3943503d2a10c24545ddec92368fe66a5cc1faa

Author: Heide Onas Auri

Committer: GitHub

## Message

```
std.time.Timer.lap: only read system time once (#4533)

Calling Timer.lap queried the system time twice; once to compute the lap
time and once to reset the timer. This can lead to time discrepancies
between actual and computed durations when summing the result of
Timer.lap in a loop. This commit fixes that.

also fix Timer.read to not require a pointer
```

## Parents

- [cfe1fbad0f6a47fa0f5798df1423702b84bf34aa](https://git.cafe/gitcafe/zig/commit/cfe1fbad0f6a47fa0f5798df1423702b84bf34aa?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/907c5589ae20d1b2a73acf26c9d67139dfe3bfb9?format=markdown)
