On Saturday, 8 June 2024 at 18:25:20 UTC, drug007 wrote:

```d
    {
        const seed = castFrom!long.to!uint(Clock.currStdTime);
        auto rng = Random(seed);
auto result = generate!(() => uniform(0, 10, rng))().take(7);
        // new random numbers sequence every time
        result.writeln;
    }
```

If UnixTime is desired, it is sufficient to have currTime.toUnixTime instead of currStdTime. It will not reset until January 19, 2038.

```d
auto seed = to!uint(Clock.currTime.toUnixTime);
```

SDB@79

Reply via email to