1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-01-27 06:35:04 +00:00

Added an extra safety rail.

This commit is contained in:
Thomas Harte 2016-10-20 07:36:53 -04:00
parent 21cfb39ed9
commit f13d7ed6f4

View File

@ -38,7 +38,7 @@
{
dispatch_async(_serialDispatchQueue, ^{
NSTimeInterval timeInterval = [NSDate timeIntervalSinceReferenceDate];
if(_previousTimeInterval > DBL_EPSILON)
if(_previousTimeInterval > DBL_EPSILON && timeInterval > _previousTimeInterval)
{
NSTimeInterval timeToRunFor = timeInterval - _previousTimeInterval;
double cyclesToRunFor = timeToRunFor * self.clockRate + _cyclesError;