labs18

package
v0.0.0-...-6c2044b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

README

测试switch和回调函数效率差异。

实验结果:

dada-imac:labs18 dada$ go test -bench=".*"
testing: warning: no tests to run
PASS
Benchmark_UseSwitch	200000000	         9.58 ns/op
Benchmark_UseCallback	200000000	         8.05 ns/op
ok  	github.com/idada/go-labs/labs18	5.323s

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MyObject

type MyObject struct {
	// contains filtered or unexported fields
}

func New

func New() *MyObject

func NewCallback

func NewCallback() *MyObject

func (*MyObject) UseCallback

func (obj *MyObject) UseCallback() int

func (*MyObject) UseSwitch

func (obj *MyObject) UseSwitch() int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL