2
0

3 Commits

Author SHA1 Message Date
Jack Christensen 40069f25d6 Remove compat layer and use generics directly
Backwards compatibility is not required since moving to v2.
2022-07-30 11:26:33 -05:00
Столяров Владимир Алексеевич 4e95984946 Move main logic to package and use generics for API with backwards compatibility 2022-04-04 07:56:16 -05:00
Jack Christensen 807afe48a8 Use runtime.nanotime for duration tracking plus related restructuring
runtime.nanotime is significantly faster than time.Now. Use it unless
build tags prevent usage of unsafe.

Change LastUsedTime to LastUsedNanotime as a time.Time is no longer
available.

Add IdleDuration to make it more convenient to get the time a resource
has been idle.

Rename ReleaseIdle to ReleaseUnused to better indicate it is releasing
the resource without using it rather than that it is releasing a
resource acquired with AcquireAllIdle.

Refactor tests of usage tracking to not be intermingled with
AcquireAllIdle tests.
2020-01-25 18:47:55 -06:00