mirror of
https://github.com/Effect-TS/effect.git
synced 2026-12-01 03:05:36 +08:00
14 lines
406 B
TypeScript
14 lines
406 B
TypeScript
import * as Arr from "effect/Array"
|
|
import * as Effect from "effect/Effect"
|
|
import * as Stream from "effect/StreamArray"
|
|
|
|
console.time("Array")
|
|
Stream.fromIterable(Arr.range(1, 100_000)).pipe(
|
|
Stream.mapEffect((i) => Effect.succeed(i + 1)),
|
|
Stream.mapEffect((i) => Effect.succeed(i + 1)),
|
|
Stream.mapEffect((i) => Effect.succeed(i + 1)),
|
|
Stream.runDrain,
|
|
Effect.runSync
|
|
)
|
|
console.timeEnd("Array")
|