mirror of
https://gitee.com/johng/gf.git
synced 2024-12-05 05:37:55 +08:00
39 lines
777 B
Go
39 lines
777 B
Go
|
// Copyright 2018 gf Author(https://github.com/gogf/gf). All Rights Reserved.
|
||
|
//
|
||
|
// This Source Code Form is subject to the terms of the MIT License.
|
||
|
// If a copy of the MIT was not distributed with this file,
|
||
|
// You can obtain one at https://github.com/gogf/gf.
|
||
|
|
||
|
// go test *.go -bench=".*"
|
||
|
|
||
|
package guid_test
|
||
|
|
||
|
import (
|
||
|
"github.com/gogf/gf/util/guid"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func Benchmark_S(b *testing.B) {
|
||
|
for i := 0; i < b.N; i++ {
|
||
|
guid.S()
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func Benchmark_New1(b *testing.B) {
|
||
|
for i := 0; i < b.N; i++ {
|
||
|
guid.New([]byte("123"))
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func Benchmark_New2(b *testing.B) {
|
||
|
for i := 0; i < b.N; i++ {
|
||
|
guid.New([]byte("123"), []byte("456"))
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func Benchmark_New3(b *testing.B) {
|
||
|
for i := 0; i < b.N; i++ {
|
||
|
guid.New([]byte("123"), []byte("456"), []byte("789"))
|
||
|
}
|
||
|
}
|