3 ms·
Here's an implementation in C# that more faithfully matches what you have to do in Go: var cnt = int.Parse(args[0]); var evt = new CountdownEvent(cnt);
by neonsunset 2y ago
Here's an implementation in C# that more faithfully matches what you have to do in Go:
var cnt = int.Parse(args[0]);
var evt = new CountdownEvent(cnt);
for (var i = 0; i < cnt; i++) {
async Task Execute() {
await Task.Delay(TimeSpan.FromSeconds(10));
evt.Signal();
}
_ = Execute();
}
evt.Wait();
It ends up consuming roughly 264.5 MB on ARM64 macOS 15.1.1 (compiled with NativeAOT).