MCPcopy Create free account
hub / github.com/SimHacker/micropolis / randomlySeedRandom

Method randomlySeedRandom

MicropolisCore/src/MicropolisEngine/src/random.cpp:155–164  ·  view source on GitHub ↗

Initialize the random number generator with a 'random' seed. */

Source from the content-addressed store, hash-verified

153
154/** Initialize the random number generator with a 'random' seed. */
155void Micropolis::randomlySeedRandom()
156{
157#ifdef _WIN32
158 seedRandom(::GetTickCount());
159#else
160 struct timeval time;
161 gettimeofday(&time, NULL);
162 seedRandom(time.tv_usec ^ time.tv_sec);
163#endif
164}
165
166
167/**

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected