'use strict';

var velocityPerSecond = require('../../../../../../../../motion-utils@12.36.0/node_modules/motion-utils/dist/es/velocity-per-second.js');

const velocitySampleDuration = 5; // ms
function getGeneratorVelocity(resolveValue, t, current) {
    const prevT = Math.max(t - velocitySampleDuration, 0);
    return velocityPerSecond.velocityPerSecond(current - resolveValue(prevT), t - prevT);
}

exports.getGeneratorVelocity = getGeneratorVelocity;
