Skip to content

Instantly share code, notes, and snippets.

@hbi99
Last active November 27, 2015 13:26
Show Gist options
  • Save hbi99/e445aef3ef2f986572ca to your computer and use it in GitHub Desktop.
Save hbi99/e445aef3ef2f986572ca to your computer and use it in GitHub Desktop.
// start the timer
var start = Date.now();
// get the snapshot with a callback function
Defiant.getSnapshot(data, function(snapshot) {
console.log('Created snapshot in '+ (Date.now() - start) +' ms');
// searching on snapshot created with web worker
var found = JSON.search(snapshot, '//item');
console.log(found);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment