File: bench_test.go

package info (click to toggle)
golang-websocket 0.0~git20150811.0.b6ab76f-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 208 kB
  • ctags: 222
  • sloc: makefile: 25
file content (19 lines) | stat: -rw-r--r-- 409 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Copyright 2014 The Gorilla WebSocket Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package websocket

import (
	"testing"
)

func BenchmarkMaskBytes(b *testing.B) {
	var key [4]byte
	data := make([]byte, 1024)
	pos := 0
	for i := 0; i < b.N; i++ {
		pos = maskBytes(key, pos, data)
	}
	b.SetBytes(int64(len(data)))
}