setScale method
Rejects a non-finite or non-positive value and leaves scale
unchanged — an invalid scale must never "poison" the clock (e.g. NaN
propagating into every future elapsed).
Implementation
SdkResult<double> setScale(double value) {
if (!value.isFinite || value <= 0) {
return const SdkFailure(
kind: SdkErrorKind.validation,
message: 'Time scale must be finite and > 0',
);
}
_scale = value;
return SdkSuccess(value);
}