using webkit-style logic for calculating delay of frame