Created
September 17, 2010 15:19
-
-
Save chrisnicola/584384 to your computer and use it in GitHub Desktop.
This file contains 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
// ==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