Re: Fwd: Monotonic Time
| From: | Niklas Keller | Date: | Fri, 13 Jan 2017 15:46:13 +0000 |
| Subject: | Re: Fwd: Monotonic Time | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-97744@lists.php.net to get a copy of this message | ||
2017-01-13 15:06 GMT+01:00 Leigh <leight@gmail.com>:
> On Fri, 13 Jan 2017 at 09:35 Niklas Keller <me@kelunik.com> wrote:
>
> > Hi Anatol,
> >
> > Do you think we should merge hrtime into core or add a simple function
> just
> > like microtime() to ext/standard?
> >
> > Regards, Niklas
> >
>
> It would be great if it could be a simple function, however it is going to
> be difficult to produce something cross-platform and meaningful with a
> single function. (I know Anatol has written portable code, I haven't looked
> at it but I assume it's wrapping the various structs used by i.e.
> performance counters, hrtime, etc.)
>
> I don't think we can get away from having an object-based implementation to
> wrap those internal structs, but I do think this is a useful addition
> regardless of how it's presented.
>
With timer.c it's very easy to have it as one function, in fact it's a
simple static method currently doing exactly what I think it should
probably do in core as a function.
http://svn.php.net/viewvc/pecl/hrtime/trunk/hrtime.c?revision=341600&view=markup
< Line 416.
Any name suggestions?
Regards, Niklas