Skip to content

Commit

Permalink
FastRand: added GenerateSeed static function
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMostDiligent committed Jun 22, 2023
1 parent fd54875 commit ebfb01b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Common/interface/FastRand.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

#pragma once

#include <chrono>

#include "../../Platforms/Basic/interface/DebugUtilities.hpp"

namespace Diligent
Expand All @@ -53,6 +55,11 @@ class FastRand
return (State >> StateType{16}) & Max;
}

static StateType GenerateSeed()
{
return static_cast<StateType>(std::chrono::high_resolution_clock::now().time_since_epoch().count());
}

private:
StateType State;
};
Expand Down

0 comments on commit ebfb01b

Please sign in to comment.