Thread overview | |||||||||
---|---|---|---|---|---|---|---|---|---|
|
August 23, 2009 What time is it? | ||||
---|---|---|---|---|
| ||||
Is there any way in Phobos to measure the current time with microsecond accuracy? Max |
August 23, 2009 Re: What time is it? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Max | Reply to Max, > Is there any way in Phobos to measure the current time with > microsecond accuracy? > > Max > "TicksPerSecond Will be at least 1000" getUTCtime() http://digitalmars.com/d/1.0/phobos/std_date.html |
August 23, 2009 Re: What time is it? | ||||
---|---|---|---|---|
| ||||
Posted in reply to BCS | Reply to Benjamin,
> Reply to Max,
>
>> Is there any way in Phobos to measure the current time with
>> microsecond accuracy?
>>
>> Max
>>
> "TicksPerSecond Will be at least 1000"
>
> getUTCtime()
>
> http://digitalmars.com/d/1.0/phobos/std_date.html
>
who made mili and micro so darn alike?
IIRC you can use C's stuff.
|
August 23, 2009 Re: What time is it? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Max | Max wrote: > Is there any way in Phobos to measure the current time with microsecond accuracy? > > Max Might I suggest std.perf? I found it here some years ago: http://www.digitalmars.com/techtips/timing_code.html It even seems to have survived the transition from D1 to D2. Oddly enough, this rather useful module never seems to never be included in the web documentation. :( Just read the comments in the source file that comes with your compiler. {dmd-path}/src/phobos/std/perf.d I've always used PerformanceCounter with good results. |
August 29, 2009 Re: What time is it? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Chad J | Chad J Wrote:
> Max wrote:
> > Is there any way in Phobos to measure the current time with microsecond accuracy?
> >
> > Max
>
> Might I suggest std.perf?
>
> I found it here some years ago: http://www.digitalmars.com/techtips/timing_code.html
>
> It even seems to have survived the transition from D1 to D2.
>
> Oddly enough, this rather useful module never seems to never be included in the web documentation. :(
>
> Just read the comments in the source file that comes with your compiler. {dmd-path}/src/phobos/std/perf.d
>
> I've always used PerformanceCounter with good results.
I also use it. Why does it not get inserted on D1 and D2?
thanks,
josé
|
August 29, 2009 Re: What time is it? | ||||
---|---|---|---|---|
| ||||
Posted in reply to jicman | On Fri, Aug 28, 2009 at 11:03 PM, jicman<cabrera_@_wrc.xerox.com> wrote: > Chad J Wrote: > >> Max wrote: >> > Is there any way in Phobos to measure the current time with microsecond accuracy? >> > >> > Max >> >> Might I suggest std.perf? >> >> I found it here some years ago: http://www.digitalmars.com/techtips/timing_code.html >> >> It even seems to have survived the transition from D1 to D2. >> >> Oddly enough, this rather useful module never seems to never be included in the web documentation. :( >> >> Just read the comments in the source file that comes with your compiler. {dmd-path}/src/phobos/std/perf.d >> >> I've always used PerformanceCounter with good results. > > I also use it. Why does it not get inserted on D1 and D2? > > thanks, > > josé std.perf was added *years* ago, in D's infancy. It wasn't even written by Walter, so the docs never made it into the DM pages. The documentation embedded in it isn't even DDoc, it's Doxygen. It's always been sort of a misfit. |
August 29, 2009 Re: What time is it? | ||||
---|---|---|---|---|
| ||||
On Fri, Aug 28, 2009 at 8:36 PM, Jarrett Billingsley<jarrett.billingsley@gmail.com> wrote: > On Fri, Aug 28, 2009 at 11:03 PM, jicman<cabrera_@_wrc.xerox.com> wrote: >> Chad J Wrote: >> >>> Max wrote: >>> > Is there any way in Phobos to measure the current time with microsecond accuracy? >>> > >>> > Max >>> >>> Might I suggest std.perf? >>> >>> I found it here some years ago: http://www.digitalmars.com/techtips/timing_code.html >>> >>> It even seems to have survived the transition from D1 to D2. >>> >>> Oddly enough, this rather useful module never seems to never be included in the web documentation. :( >>> >>> Just read the comments in the source file that comes with your compiler. {dmd-path}/src/phobos/std/perf.d >>> >>> I've always used PerformanceCounter with good results. >> >> I also use it. Why does it not get inserted on D1 and D2? >> >> thanks, >> >> josé > > std.perf was added *years* ago, in D's infancy. It wasn't even written by Walter, so the docs never made it into the DM pages. The documentation embedded in it isn't even DDoc, it's Doxygen. It's always been sort of a misfit. That hasn't been true for over a year. I cleaned it up a while back and made sure it worked with D2 [1]. The doc comments are all DDoc now. See for yourself [2]. Just hasn't been added to the index for some reason. [1] http://www.dsource.org/projects/phobos/log/trunk/phobos/std/perf.d [2] http://www.dsource.org/projects/phobos/browser/trunk/phobos/std/perf.d --bb |
Copyright © 1999-2021 by the D Language Foundation