file: time_utils.dart
dependencies: import 'package:dart_helper_utils/dart_helper_utils.dart';

TimeUtils: (Abstract Class)
  Define: Provides utility methods for time-related operations.
  Methods:
    executionDuration(FutureOr<void> Function() task): (Static Method)
      Define: Measures the execution time of a synchronous or asynchronous task.
      Parameters:
        task: (FutureOr<void> Function()) - The task to execute.
      Returns: (Future<Duration>) - The execution duration.
      Operational Notes:
        Uses `Stopwatch` for precise timing.
        Handles both synchronous and asynchronous tasks.

    executionDurations(List<FutureOr<void> Function()> tasks): (Static Method)
      Define: Measures execution times for a list of tasks.
      Parameters:
        tasks: (List<FutureOr<void> Function()>) List of tasks.
      Returns: (Future<List<Duration>>) List of durations.

    compareExecutionTimes({required FutureOr<void> Function() taskA, required FutureOr<void> Function() taskB}): (Static Method)
      Define: Compares execution times of two tasks.
      Parameters:
        taskA: (FutureOr<void> Function()) - The first task.
        taskB: (FutureOr<void> Function()) - The second task.
      Returns: (Future<(Duration, Duration)>) - A tuple containing the durations of `taskA` and `taskB`.

    throttle(void Function() func, Duration interval): (Static Method)
      Define: Creates a throttled function.
      Parameters:
        func: (void Function()) - The function to throttle.
        interval: (Duration) - The minimum interval between invocations.
      Returns: (Function) - A throttled function.
      Operational Notes: Only invokes the given function at most once per every interval.

     runPeriodically({required Duration interval, required void Function(Timer timer, int count) onExecute}): (Static Method)
      Define: Executes a given function periodically.
      Parameters:
        interval: (Duration) - The interval between executions.
        onExecute: (void Function(Timer timer, int count)) - Callback executed after each function execution, It receives the running timer instance, and execution count.
      Returns: (Timer) returns the timer instance that executes periodically.
      Operational Notes:
        Uses `Timer.periodic` to execute given function periodically.

    runWithTimeout<T>({required FutureOr<T> Function() task, required Duration timeout}): (Static Method)
      Define: Executes a function with a timeout.
      Parameters:
        task: (FutureOr<T> Function()) - The function to execute.
        timeout: (Duration) - The timeout duration.
      Returns: (Future<T>) - The result of the function, or a `TimeoutException` if it times out.
      Operational Notes:
       Uses `Completer` and `Timer` to manage timeout.  Cancels the timer on completion or error.
  Operational Notes:
   Abstract Class: cannot be instantiated.
