Commit Graph

4 Commits (60adc098da2d3026280bd0caa10915d6c8e6e14f)

Author SHA1 Message Date
Jeremy Ong 5b76d47e17 Remove time tests that relied on main-thread sleeps
Sleeping in tests and attempting to rely on fine-grained measurements to
check code validity is intrinsically brittle. Wall-clock time is
unreliable in an environment where tests are run under a hypervisor that
may choose to suspend your VM at any point, or in situations where the
OS cannot schedule your thread in time. The correct way to reintroduce
these tests in the future is provide an override for the timestamp
queries that can be injected in the test environment to control the wall
time deterministically.

Signed-off-by: Jeremy Ong <jcong@amazon.com>
4 years ago
amzn-sean fea4d0e6b1
adding TimeSystem unit tests (#6446)
Signed-off-by: amzn-sean <75276488+amzn-sean@users.noreply.github.com>
4 years ago
amzn-sean 38a03817bb
Removal and Replacement of the CryTimer (gEnv->pTimer) (#5409)
Replaced and removed the CryTimer (gEnv->pTimer). The new TimeSystem is a merger of the current time functionality found in the engine.

* Rename TimeSystemComponent.h/.cpp to TimeSystem.h/.cpp
* Adding New TimeSystem
* remove old timer cvars
* small improvements to the time system.
 - updated parts to use the time conversion functions.
 - in AdvanceTickDeltaTimes applying t_simulationTickScale is now uses doubles instead of floats.
* Replace gEnv->pTimer / ITimer usages with TimeSystem
* Updating usages of AZ::TimeMs{ 0 } and AZ::TimeUs{ 0 } to AZ::Time::ZeroTimeMs and AZ::Time::ZeroTimeUs
* red code the CryTimer
* using TimeUs instead of TimeMs is some cases + updating usages of old cvars to new

Signed-off-by: amzn-sean <75276488+amzn-sean@users.noreply.github.com>
4 years ago
kberg-amzn bf136a567b Some shutdown crash fixes, reverted a whitespace, and added some basic unit tests for time additions
Signed-off-by: kberg-amzn <karlberg@amazon.com>
4 years ago