diff options
Diffstat (limited to 'ethutil/common.go')
-rw-r--r-- | ethutil/common.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ethutil/common.go b/ethutil/common.go index 0a29cac6c..2ef2440c7 100644 --- a/ethutil/common.go +++ b/ethutil/common.go @@ -4,6 +4,7 @@ import ( "fmt" "math/big" "runtime" + "time" ) func IsWindows() bool { @@ -84,4 +85,11 @@ var ( BigFalse = Big0 Big32 = big.NewInt(32) Big256 = big.NewInt(0xff) + Big257 = big.NewInt(257) ) + +func Bench(pre string, cb func()) { + start := time.Now() + cb() + fmt.Println(pre, ": took:", time.Since(start)) +} |