mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-23 13:38:35 +00:00
20 lines
439 B
Go
20 lines
439 B
Go
|
package fee
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"github.com/nspcc-dev/neo-go/pkg/vm/opcode"
|
||
|
)
|
||
|
|
||
|
const feeFactor = 30
|
||
|
|
||
|
// The most common Opcode() use case is to get price for single opcode.
|
||
|
func BenchmarkOpcode1(t *testing.B) {
|
||
|
// Just so that we don't always test the same opcode.
|
||
|
script := []opcode.Opcode{opcode.NOP, opcode.ADD, opcode.SYSCALL, opcode.APPEND}
|
||
|
l := len(script)
|
||
|
for n := 0; n < t.N; n++ {
|
||
|
_ = Opcode(feeFactor, script[n%l])
|
||
|
}
|
||
|
}
|