I want to do the following:
Create 100 fibers
In each fiber, loop 1000 times and increment my
RefAfter each fiber has completed 1000 iterations, shutdown the fiber
Before exiting the program, output the current value of the Ref.
object Fibers extends IOApp.Simple { val program = for { ref <- Ref.of[IO, Int](0) total <- ref.get _ <- IO(println(s"ref total is: ${total}")) } yield () override def run: IO[Unit] = program }
I also want to time how long this takes to complete (in milliseconds)...