Created
December 16, 2020 18:04
-
-
Save CodeSandwich/c4570b93c5c260fd330b1e5b7551ae0d to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.7.6+commit.7338295f.js&optimize=true&runs=200&gist=
This file contains hidden or 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
pragma solidity ^0.7.6; | |
contract Bench { | |
uint256 public data; | |
function increment() public { | |
uint256 gasUsed = gasleft(); | |
uint256 dataLocal = data; | |
gasUsed -= gasleft(); | |
dataLocal += gasUsed; | |
data = dataLocal; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment