ios: accurate GetDelay() function