MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / FastRnd

Class FastRnd

modules/core/task/src/task2.cpp:25–36  ·  view source on GitHub ↗

https://en.wikipedia.org/wiki/Xorshift

Source from the content-addressed store, hash-verified

23
24// https://en.wikipedia.org/wiki/Xorshift
25class FastRnd {
26 public:
27 inline uint64_t operator()() {
28 x ^= x << 13;
29 x ^= x >> 7;
30 x ^= x << 17;
31 return x;
32 }
33
34 private:
35 uint64_t x = std::chrono::system_clock::now().time_since_epoch().count();
36};
37
38namespace skr
39{

Callers

nothing calls this directly

Calls 2

time_since_epochMethod · 0.80
countMethod · 0.45

Tested by

no test coverage detected