TimeUtils class abstract

Constructors

TimeUtils()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

compareExecutionTimes({required FutureOr<void> taskA(), required FutureOr<void> taskB()}) Future<(Duration, Duration)>
Compares the execution durations of two tasks, accommodating both synchronous and asynchronous operations.
executionDuration(FutureOr<void> task()) Future<Duration>
Calculates the execution duration of a task, accommodating both synchronous and asynchronous operations.
executionDurations(List<FutureOr<void> Function()> tasks) Future<List<Duration>>
Measures the execution time for a list of tasks, whether synchronous or asynchronous.
runPeriodically({required Duration interval, required void onExecute(Timer timer, int count)}) Timer
Executes a function periodically with the given interval.
runWithTimeout<T>({required FutureOr<T> task(), required Duration timeout}) Future<T>
Executes a function with a timeout, cancelling the execution if it exceeds the specified duration.
throttle(void func(), Duration interval) Function
Creates a throttled function that only invokes the function at most once per every interval milliseconds.