15

Obviously I'm talking about time in terms of the PC clock rather than real time.

We were testing an application we've developed at work by setting the clock forward and back to simulate different scenarios and I started thinking how useful it would be if you could adjust the rate(?) of the system clock with finer control. So you could make a minute pass in a second or a day pass in 30 seconds and watch how the program you're developing copes with changes in date and time.

Is there any such software available?

I'd be interested to hear if anyone knows of any software or hardware which can let you do some or all of the above.

Carl B
  • 6,660
Tom Robinson
  • 2,460

5 Answers5

6

It's not necessarily going to speed up time, but it can be useful for debugging.

Nirsoft's RunAsDate

From the site:

RunAsDate is a small utility that allows you to run a program in the date and time that you specify. This utility doesn't change the current system date and time of your computer, but it only injects the date/time that you specify into the desired application. You can run multiple applications simultaneously, each application works with different date and time, while the real date/time of your system continues to run normally.

Keck
  • 2,116
4

On unix systems, libfaketime is the de facto standard solution for this problem in software. It performs a sort of man-in-the-middle operation between your application and the system's time library. The requests are passed through to the system, but the replies are modified as needed. It also modifies the results of stat() calls, so file modification times & c. are also modified.

The settings are made with environment variables, so you might have to learn about those if you're not already familiar with their workings.

libfaketime supports relative and absolute offsets, stopped and running time and speeding up or slowing down. I don't know about running backwards, though.

Note that the current version pretends seconds are the highest resolution of time there is, and passes sub-second parts of responses through to the application unmodified. Thus, if you slow down the clock to half speed, a sub-seconds aware program making very rapid time calls will experience the whole second twice after each other rather than once just taking twice as long. If the clock is stopped, this means the application sees a random time within the selected second.

Unfortunately, Github is down today, so the docs are unavailable right now, but that will probably be fixed soon.

Edit:

With Github back up I tried it, and found the code for speed change to be general enough that it works well with negative values or anything else accepted by atof().

However, a different issue became apparent: For speed change, a time origin is necessary in addition to the real current time and the desired time offset. This origin is set independently for subprocesses, so that (when running backwards at nominal speed) when the parent process has retracted one minute, a newly spawned subprocess will see the current time as two minutes later than the parent process does.

Eroen
  • 6,561
1

You could always script it. (Does CMD still support the DATE/TIME commands?)

Any program you'd end up using would probably work by resetting the time in small increments anyways. If you didn't need super-fine-grained control, a batch script (or perl:) could control those changes pretty easily.

Gotchas: NTP update services would need to be turned off to use this solution, so that the OS didn't keep resetting the clock back to whatever it's supposed to be.

quack quixote
  • 43,504
1

I spotted a reference to an old program called ASpeeder. I've no idea how it works, if it works, or if it's an ancient scam site. Try at your own risk. Hail Eris.

It is payware ($20). Take a look, and be sure to virus-check the download before you install.

A Speeder 2008.4 Features (from the website):

  • Change the speed of desktop games or online games
  • Control application speed and windows speed
  • Easy to use, just drag the track bar or press hotkey
  • From 1/32 times speed to 32 times system speed
  • From 1/256 times speed to 256 times Windows speed
  • The speed setting is locked automatically
  • Offer three kinds of methods to change speed

enter image description here

Gareth
  • 19,080
quack quixote
  • 43,504
0

Virtual machines can be sped up, so dor example VirtualBox:

VBoxManage setextradata "VM name" "VBoxInternal/TM/WarpDrivePercentage" 200
Andris
  • 101