github.com/m4gshm/gollections@v0.0.13-0.20240331203319-a34a86e58a24/slice/test/benchmark_test.go (about)

     1  package test
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/m4gshm/gollections/notsafe"
     7  )
     8  
     9  type someType struct {
    10  	field1 string
    11  	field2 int64
    12  }
    13  
    14  func Benchmark_GetTypeSize(b *testing.B) {
    15  	var size uintptr
    16  	for i := 0; i < b.N; i++ {
    17  		size = notsafe.GetTypeSize[someType]()
    18  	}
    19  	_ = size
    20  }