go-ethereum/common/common.go

27 lines
433 B
Go
Raw Normal View History

2015-03-16 11:27:38 +01:00
package common
2014-02-25 11:20:24 +01:00
import (
"fmt"
"math/big"
"time"
2014-02-25 11:20:24 +01:00
)
// Common big integers often used
var (
Big1 = big.NewInt(1)
Big2 = big.NewInt(2)
2014-10-27 11:44:16 +01:00
Big3 = big.NewInt(3)
Big0 = big.NewInt(0)
BigTrue = Big1
BigFalse = Big0
Big32 = big.NewInt(32)
Big256 = big.NewInt(0xff)
2015-01-13 00:25:45 +01:00
Big257 = big.NewInt(257)
)
func Bench(pre string, cb func()) {
start := time.Now()
cb()
fmt.Println(pre, ": took:", time.Since(start))
}