diff options
author | obscuren <geffobscura@gmail.com> | 2015-02-20 05:33:22 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-02-20 05:33:22 +0800 |
commit | fa4cbad315609e41d88c59ecbce7c6c6169fc57a (patch) | |
tree | 5af4a3cfd497e682e41898059571b75f6f8e4cf9 /ethutil/common.go | |
parent | c14071df9da4ab3f5b372293e87184af9b91c09e (diff) | |
download | go-tangerine-fa4cbad315609e41d88c59ecbce7c6c6169fc57a.tar go-tangerine-fa4cbad315609e41d88c59ecbce7c6c6169fc57a.tar.gz go-tangerine-fa4cbad315609e41d88c59ecbce7c6c6169fc57a.tar.bz2 go-tangerine-fa4cbad315609e41d88c59ecbce7c6c6169fc57a.tar.lz go-tangerine-fa4cbad315609e41d88c59ecbce7c6c6169fc57a.tar.xz go-tangerine-fa4cbad315609e41d88c59ecbce7c6c6169fc57a.tar.zst go-tangerine-fa4cbad315609e41d88c59ecbce7c6c6169fc57a.zip |
Optimisations and fixed a couple of DDOS issues in the miner
Diffstat (limited to 'ethutil/common.go')
-rw-r--r-- | ethutil/common.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ethutil/common.go b/ethutil/common.go index 271c56fd5..2ef2440c7 100644 --- a/ethutil/common.go +++ b/ethutil/common.go @@ -4,6 +4,7 @@ import ( "fmt" "math/big" "runtime" + "time" ) func IsWindows() bool { @@ -86,3 +87,9 @@ var ( 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)) +} |