(C++) RandomizeTimer

January 17, 2018 ยท View on GitHub

RandomizeTimer is random numbers code snippet to set a random seed using the computer timer. The function name comes from the QBasic command 'RANDOMIZE TIMER', which served the same purpose.

#include <cstdlib>
#include <ctime>
 
void RandomizeTimer()
{
  std::srand(std::time(0));
}