package ordercalc
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func Test_NewNumber(t *testing.T) {
|
|
|
|
t.Log(time.Now().UnixNano())
|
|
|
|
var set map[string]int
|
|
set = make(map[string]int)
|
|
|
|
var i, reply int = 0, 0
|
|
var num string
|
|
|
|
for i < 100000 {
|
|
i++
|
|
num = VerifyNumber()
|
|
if _, ok := set[num]; ok {
|
|
reply++
|
|
} else {
|
|
set[num] = i
|
|
}
|
|
}
|
|
|
|
t.Log("reply:", reply)
|
|
// t.Log(set)
|
|
}
|