aboutsummaryrefslogtreecommitdiffstats
path: root/ethutil/common.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-02-20 05:33:22 +0800
committerobscuren <geffobscura@gmail.com>2015-02-20 05:33:22 +0800
commitfa4cbad315609e41d88c59ecbce7c6c6169fc57a (patch)
tree5af4a3cfd497e682e41898059571b75f6f8e4cf9 /ethutil/common.go
parentc14071df9da4ab3f5b372293e87184af9b91c09e (diff)
downloaddexon-fa4cbad315609e41d88c59ecbce7c6c6169fc57a.tar
dexon-fa4cbad315609e41d88c59ecbce7c6c6169fc57a.tar.gz
dexon-fa4cbad315609e41d88c59ecbce7c6c6169fc57a.tar.bz2
dexon-fa4cbad315609e41d88c59ecbce7c6c6169fc57a.tar.lz
dexon-fa4cbad315609e41d88c59ecbce7c6c6169fc57a.tar.xz
dexon-fa4cbad315609e41d88c59ecbce7c6c6169fc57a.tar.zst
dexon-fa4cbad315609e41d88c59ecbce7c6c6169fc57a.zip
Optimisations and fixed a couple of DDOS issues in the miner
Diffstat (limited to 'ethutil/common.go')
-rw-r--r--ethutil/common.go7
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))
+}