wall clock
The computer's real current time, which keeps moving while a program or test runs.
In more detail
Wall clocks can be adjusted, so measuring durations with them can give wrong or even negative results. Use a monotonic clock for elapsed time and the wall clock for timestamps people read.
Examples
Go: time.Since uses the monotonic clock automaticallyIn this course: Code that reads the wall clock directly has a hidden input. A test that asserts on it, such as expecting the seconds to be zero, fails almost every time.Related terms
- time.Since — The Go function that returns how much time has passed since a given moment, as a time.Duration.
- UTC — Coordinated Universal Time, the worldwide reference time that does not change with seasons or time zones.
- clock skew — The difference between the times reported by clocks on different machines.
- frozen time — Making the current time a fixed value during a test, by passing an instant in or patching the clock.
- datetime — The Python standard-library module and type that represent a date and time of day.
- flaky test — A test that sometimes passes and sometimes fails on the same code, because it depends on something it does not control.
Taught in
- The Standard testing Package — Concurrent Systems Programming with Go
- The time Package — Concurrent Systems Programming with Go
- The Test Pyramid And Where It Is Wrong — Automated Testing, TDD & Quality Engineering
- Testing Time And Randomness — Automated Testing, TDD & Quality Engineering
- Flaky Tests And How To Kill Them — Automated Testing, TDD & Quality Engineering