Re: custom Nano time provider
Francesco Nigro via Concurrency-interest <[email protected]> Sun, 5 Apr 2020 13:44:54 +0200
| Newsgroups | gmane.comp.java.jsr.166-concurrency |
|---|---|
| Message-ID | <CAKxGtTWo9=2GwaBm8jemanBjWzbiiW7Lp-kkV1FW8=aQykJnEA@mail.gmail.com> |
Thanks Jonas, I am aware of such API, but my request is to allow the existing primitives that uses System::nanoTime and System::currentTimeMillis (eg many lock implementations) to uses a custom time provider. Il dom 5 apr 2020, 13:34 Jonas Konrad via Concurrency-interest < [email protected]> ha scritto: > Java 8 introduced the java.time.Clock API. This can replace > currentTimeMillis for ease of testing. > > I don't think such an API exists for nanoTime. I'm not sure how > realistic such an API would be since users of nanoTime are presumably > interested in accuracy. > > - Jonas > > On 4/5/20 1:23 PM, Francesco Nigro via Concurrency-interest wrote: > > Hi folks, > > > > In the recent period I am working on some high availability solution in > > the project I currently work and I have noticed how is important for > > testing purposes to use custom System::currentTimeMillis and > > System::nanoTime providers to trigger specific reproducible conditions: > > there is any plan to allow something similar in some of the concurrent > > primitive that make uses of such functions? > > I believe this could help both implementors and users. > > > > > > Thanks, > > Franz > > > > _______________________________________________ > > Concurrency-interest mailing list > > [email protected] > > http://cs.oswego.edu/mailman/listinfo/concurrency-interest > > > _______________________________________________ > Concurrency-interest mailing list > [email protected] > http://cs.oswego.edu/mailman/listinfo/concurrency-interest > _______________________________________________ Concurrency-interest mailing list [email protected] http://cs.oswego.edu/mailman/listinfo/concurrency-interest