Skip to content

Instantly share code, notes, and snippets.

@chrisnicola
Created September 17, 2010 15:19
Show Gist options
  • Save chrisnicola/584384 to your computer and use it in GitHub Desktop.
Save chrisnicola/584384 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @author Chris
// @co-author None
// @name Timer
// @namespace myTest
// @description eRepublik Advanced Tools
// @version 1.0.0
// @include *
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js
// ==/UserScript==
alert('Test');
var startTime;
jQuery(document).ready(function {
startTime = new Date();
$("form").submit(function() { onSubmit(); });
}
function onSubmit() {
var endTime = new Date();
var elapsed = endTime.getTime() - startTime.getTime();
alert(elapsed/1000 + ' seconds have elapsed');
jQuery("input[name='q']").val(elapsed/1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment