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; > writeln(sw.pee

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 c

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 c

Re: StopWatch

2015-10-20 Thread Russel Winder via Digitalmars-d-learn
On Tue, 2015-10-20 at 15:16 +0100, Russel Winder wrote: > […] > What import statement do you use to get MonoTime.  I tried the above > and got an error with all the things I tried. Hummm… I am now not worried about the import, I tried compiling a different way and it worked. The upshot is that I

Re: StopWatch

2015-10-20 Thread Russel Winder via Digitalmars-d-learn
On Tue, 2015-10-20 at 02:19 -0700, Jonathan M Davis via Digitalmars-d- learn wrote: > […] > > auto before = MonoTime.currTime; > // do stuff > auto diff = MonoTime.currTime - before; What import statement do you use to get MonoTime.  I tried the above and got an error with all the things I tried.

Re: StopWatch

2015-10-20 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, October 20, 2015 13:18:12 Shriramana Sharma via Digitalmars-d-learn wrote: > http://dlang.org/phobos/std_datetime.html#StopWatch shows the use of > TickDuration to measure the time elapsed, but > http://dlang.org/phobos/core_time.html#TickDuration says TickDuration is due > to be depre