import 'dart:async'; abstract mixin class Task { int get intervalSeconds; String get name; Future task(); Future run() async { final stopwatch = Stopwatch()..start(); print('started $name ${DateTime.now()}'); try { await task(); } catch (e, s) { print('error $name ${e.toString()}, stacktrace: ${s}'); } stopwatch.stop(); print('finished $name, took ${stopwatch.elapsed}'); } }