This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* precise version of Date.now() - | |
* It provide submillisecond precision based on window.performance.now() when | |
* available, fall back on Date.now() | |
* see http://updates.html5rocks.com/2012/05/requestAnimationFrame-API-now-with-sub-millisecond-precision | |
*/ | |
var nowSubms = (function(){ | |
var p = window.performance || {}; | |
if( p.now ) return function(){ return p.timing.navigationStart + p.now(); }; | |
else if( p.mozNow ) return function(){ return p.timing.navigationStart + p.mozNow(); }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!FileReader.prototype.readAsArrayBuffer) { | |
FileReader.prototype.readAsArrayBuffer = function readAsArrayBuffer () { | |
this.readAsBinaryString.apply(this, arguments); | |
this.__defineGetter__('resultString', this.__lookupGetter__('result')); | |
Object.defineProperty(this, 'result', { | |
get : function () { | |
var string = this.resultString, | |
result = new Uint8Array(string.length); | |
for (var i = 0; i < string.length; i++) { | |
result[i] = string.charCodeAt(i); |