operator ~/ 方法
- int quotient
将此 Duration 除以指定的 quotient
,并以新的 Duration 对象的形式返回截断的结果。
必须不允许 quotient
为 0
。
实现
Duration operator ~/(int quotient) {
// By doing the check here instead of relying on "~/" below we get the
// exception even with dart2js.
if (quotient == 0) throw IntegerDivisionByZeroException();
return Duration._microseconds(_duration ~/ quotient);
}