I wanted to calculate the execution time for smart contract as below. I tried to get the elapsed time from simple code, but the result is zero. Does the program length size increased to calculate the elapsed time?
pragma solidity ^0.5.0;
function {
uint startTime = now;
uint endTime = 0;
unit elapsedTime = 0;
....
endTime = now;
elapsedTime = endTime - startTime;
}
pragma solidity ^0.5.0;
function {
uint startTime = now;
uint endTime = 0;
unit elapsedTime = 0;
....
endTime = now;
elapsedTime = endTime - startTime;
}