I'm using online solidity compiler and would like to measure the CPU time for executing a function by capturing the time at start and end of the function.
I found example for Javascript, but when tried it the compiler does not recognise 'var'
var start = new Date().getTime();
var amount = 1;
var sender = personal.listAccounts[0]
var receiver = personal.listAccounts[0]
for (i = 0; i < 5000; ++i) {
eth.sendTransaction({from:sender, to:receiver, value: amount});
}
var end = new Date().getTime();
var time = end - start;
console.log('Execution time: ' + time);
How to implement this here?