How to convert `std.datetime.Duration` to seconds of floating point type?

drug drug2004 at bk.ru
Tue Feb 19 14:34:09 UTC 2019


Now I do it this way (https://run.dlang.io/is/8kVibT):
```
	auto some_duration = dur!"msecs"(500);
	auto seconds = some_duration.total!"hnsecs" / 10_000_000.0;
	assert(seconds.approxEqual(0.5));
```
is there better way to do it?

Thanks in advance


More information about the Digitalmars-d-learn mailing list