Re: custom Nano time provider

Valentin Kovalenko via Concurrency-interest <[email protected]> Sun, 5 Apr 2020 15:15:47 -0600
Newsgroups gmane.comp.java.jsr.166-concurrency
Message-ID <CAO-wXwJgx=3vU+LtFXNE_mdcNSA=nBR+M2NiL8hNv78j+8duCg@mail.gmail.com>
Yes, having the ability to control the flow of time as perceived by JDK
concurrency classes would facilitate writing concurrency tests. Though I
hope that those classes do not use currentTimeMilllis under the hood
because it shouldn't be used to measure duration. And those 3rd party
classes that need to use currentTimeMillis (e.g. Spring cron-style
scheduling) can use Clock and provide ways of supplying custom Clock
implementations.

Valentin

------------------------------


Message: 3
Date: Sun, 5 Apr 2020 13:44:54 +0200
From: Francesco Nigro <[email protected]>
To: Jonas Konrad <[email protected]>
Cc: concurrency-interest <[email protected]>
Subject: Re: [concurrency-interest] custom Nano time provider
Message-ID:
        <CAKxGtTWo9=2GwaBm8jemanBjWzbiiW7Lp-kkV1FW8=aQykJnEA@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

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

_______________________________________________
Concurrency-interest mailing list
[email protected]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest