| 771 | var NATIVE_SET_TIMEOUT = globalThisShim.setTimeout; |
| 772 | var NATIVE_CLEAR_TIMEOUT = globalThisShim.clearTimeout; |
| 773 | function installTimerFunctions(obj, opts) { |
| 774 | if (opts.useNativeTimers) { |
| 775 | obj.setTimeoutFn = NATIVE_SET_TIMEOUT.bind(globalThisShim); |
| 776 | obj.clearTimeoutFn = NATIVE_CLEAR_TIMEOUT.bind(globalThisShim); |
| 777 | } else { |
| 778 | obj.setTimeoutFn = globalThisShim.setTimeout.bind(globalThisShim); |
| 779 | obj.clearTimeoutFn = globalThisShim.clearTimeout.bind(globalThisShim); |
| 780 | } |
| 781 | } |
| 782 | // base64 encoded buffers are about 33% bigger (https://en.wikipedia.org/wiki/Base64) |
| 783 | var BASE64_OVERHEAD = 1.33; |
| 784 | // we could also have used `new Blob([obj]).size`, but it isn't supported in IE9 |