String parseMilliseconds(int ms) { if (ms < 1000) { return '$ms ms'; } return '${(ms / 1000).toStringAsFixed(2)} s'; }