Executes a function f
in a blocking fashion.
Total time spent doing blocking operations, in nanoseconds.
Total time spent doing blocking operations, in nanoseconds.
This should only include time spent on threads where
CanAwait.trackElapsedBlocking returns true
.
-1 if the Scheduler does not support tracking this.
this does not include time spent doing blocking code
outside of Scheduler.blocking. For example,
Future(someSlowSynchronousIO)
would not be accounted
for here.
Flush the schedule.
The number of dispatches performed by this scheduler.
Swap out the current globally-set scheduler with another.
Swap out the current globally-set scheduler with another.
Note: This can be unsafe since some schedulers may be active, and flush() can be invoked on the wrong scheduler.
This can happen, for example, if a LocalScheduler is used while a future is resolved via Await.
the other Scheduler to swap in for the one that is currently set
Schedule r
to be run at some time in the future.
A global scheduler.