Re: StopWatch problem

2017-12-05 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, December 05, 2017 14:25:12 Ali Çehreli via Digitalmars-d-learn wrote: > Selective imports complicates matters. Changing the imports lets it > compile with 2.076: > > void main() { > import std.datetime; > import std.stdio: writeln; > > StopWatch sw; >

Re: StopWatch problem

2017-12-05 Thread Ali Çehreli via Digitalmars-d-learn
On 12/05/2017 01:45 PM, Jonathan M Davis wrote: > On Tuesday, December 05, 2017 21:33:53 Joel via Digitalmars-d-learn wrote: >> void main() { >>import std.datetime: Duration, msecs; >>import std.datetime.stopwatch: StopWatch; >> >>StopWatch sw; >>if (sw.peek.msecs) { >> >>}

Re: StopWatch problem

2017-12-05 Thread Joel via Digitalmars-d-learn
On Tuesday, 5 December 2017 at 21:45:20 UTC, Jonathan M Davis wrote: On Tuesday, December 05, 2017 21:33:53 Joel via Digitalmars-d-learn wrote: [...] core.time.msecs is an alias for core.time.dur!"msecs". It takes a long for the number of milliseconds and returns a Duration. If you want to

Re: StopWatch problem

2017-12-05 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, December 05, 2017 21:33:53 Joel via Digitalmars-d-learn wrote: > void main() { > import std.datetime: Duration, msecs; > import std.datetime.stopwatch: StopWatch; > > StopWatch sw; > if (sw.peek.msecs) { > > } > } > > I get this error with the code: > z.d(6): Error: function

StopWatch problem

2017-12-05 Thread Joel via Digitalmars-d-learn
void main() { import std.datetime: Duration, msecs; import std.datetime.stopwatch: StopWatch; StopWatch sw; if (sw.peek.msecs) { } } I get this error with the code: z.d(6): Error: function core.time.dur!"msecs".dur (long length) is not