Skip to content

Instantly share code, notes, and snippets.

@iMartyn
Created March 26, 2013 16:29
Show Gist options
  • Save iMartyn/5246833 to your computer and use it in GitHub Desktop.
Save iMartyn/5246833 to your computer and use it in GitHub Desktop.
var casper = require('casper').create();
var journeystage = 'ProductPage';
var journeytimings = Array();
casper.on('load.started', function() {
journeytimings[journeystage] = new Date().getTime();
});
casper.on('load.finished', function(status) {
starttime = journeytimings[journeystage];
endtime = new Date().getTime();
journeytimings[journeystage] = endtime - starttime;
});
casper.start('https://www.google.co.uk');
casper.run(function() {
this.echo('Time taken ' + journeytimings[journeystage] + ' ms');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment