wren-lang / wren

The Wren Programming Language. Wren is a small, fast, class-based concurrent scripting language.
http://wren.io
MIT License
6.93k stars 555 forks source link

Better Random objects with default seeding #1152

Open enci opened 1 year ago

enci commented 1 year ago

The no args constructor for Random creates an objects with the same seed within the same second, because time() has second resolution. Adding clock() to the seed removes this implicit and undocumented behavior.