Skip to content

Instantly share code, notes, and snippets.

@CodeSandwich
Created December 16, 2020 18:04
Show Gist options
  • Save CodeSandwich/c4570b93c5c260fd330b1e5b7551ae0d to your computer and use it in GitHub Desktop.
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=
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