Skip to main content

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;

}

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;

}

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;

}
added 6 characters in body
Source Link
JongH
  • 73
  • 1
  • 12

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

uint endTime = 0; unit

unit elapsedTime = 0;

....

endTime = now; elapsedTime

elapsedTime = endTime - startTime;

}

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;

uint startTime = now; uint endTime = 0; unit elapsedTime = 0;

....

endTime = now; elapsedTime = endTime - startTime;

}

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;

}

Source Link
JongH
  • 73
  • 1
  • 12

Solidity: Is there any way to calculate the elapsed time for smart contract?

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;

uint startTime = now; uint endTime = 0; unit elapsedTime = 0;

....

endTime = now; elapsedTime = endTime - startTime;

}