Timewarp

Virtual Time for the JVM
Alternatives To Timewarp
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Libfaketime2,2581a month ago1February 27, 201817gpl-2.0C
libfaketime modifies the system time for a single application
Elevenclock1,876
17 hours ago5gpl-3.0Python
ElevenClock: Customize Windows 11 taskbar clock
Truetime Android1,304
a day ago35apache-2.0Kotlin
Android NTP time library. Get the true current time impervious to device clock time changes
Time1,000
a year ago76C++
Time library for Arduino
Link924
3 months ago19otherC++
Ableton Link
Clock616135531a month ago15November 15, 202111mitGo
Clock is a small library for mocking time in Go.
Node Microtime5654,0776648 months ago39June 09, 20221mitC++
Get the current time in microseconds
Bemanalogclock488
116 years ago7April 28, 20162mitObjective-C
iOS library to create elegant, interactive clocks.
React Datetime Picker463924118 hours ago48September 19, 20229mitJavaScript
A datetime picker for your React app.
Literature Clock444
19 days ago3otherR
Clock using time quotes from the literature, based on the work of Jaap Meijers
Alternatives To Timewarp
Select To Compare


Alternative Project Comparisons
Readme

Time Warp
Virtual Time for the JVM

This library lets you create virtual-time clocks and install them as the JVM's clock to help with testing.

A virtual-time Clock will modify the operation of System.currentTimeMillis(), System.nanoTime(), Thread.sleep, Object.wait(long), LockSupport.parkNanos and any other operation relying on timeouts.

Use this library to slow-down/speed-up/manually control the JVM's clock to make your timing-sensitive tests less flaky.

Status

Early days. We've begun using TimeWarp's ScaledClock (and SystemClock) in Quasar tests. ManualClock hasn't been tested, so it probably doesn't work yet.

Usage

  1. Clone and build the repository with ./gradlew or use Maven artifact co.paralleluniverse:timewarp:0.1.0-SNAPSHOT from the Sonatype snapshot repository (https://oss.sonatype.org/content/repositories/snapshots)

  2. Add the JAR file to your bootstrap classpath with -Xbootclasspath/a:[timewarp jar] and as an agent with -javaagent:[timewarp jar]

  3. Install one of the provided clocks, SystemClock, ScaledClock, or ManualClock, using the VirtualClock class. Please consult the Javadocs for detailed information. Alternatively, you can pass an integer as a command-line argument to the agent (e.g. -javaagent:[timewarp jar]=3), which would install a global scaling clock, that would slow down the system clock by a factor equal to the parameter. So an argument of 3 would install a ScaledClock with a scaling factor of 0.33333.

License

MIT

Copyright (c) 2015-2016, Parallel Universe Software Co. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Popular Time Projects
Popular Clock Projects
Popular Libraries Categories

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Java
Time
Clock