getToolLoadingSeconds method

int getToolLoadingSeconds(
  1. String toolName
)

Implementation

int getToolLoadingSeconds(String toolName) {
  final String key = toolName.trim();
  final DateTime? started = _loadingToolStartedAt[key];
  if (started == null) return 0;
  // Depend on tick so UI updates once per second.
  loadingToolsTick.value;
  final int seconds = DateTime.now().difference(started).inSeconds;
  return seconds < 0 ? 0 : seconds;
}