Skip to content

VCCICCV/Arithmetic

Repository files navigation

Go语言算法库

本库用为VCCICCV学习记录,题库及解法来自力扣及网络

测试

// 压测函数:测试函数运行平均耗时
func BenchmarkLengthOfLongestSubstring(b *testing.B) {
	s := "abcabcbb" // 测试字符串
	for i := 0; i < b.N; i++ {
		lengthOfLongestSubstring(s) // 测试函数
	}
}
// 统计内存占用
func memoryUsage(t *testing.T) {
	var mem runtime.MemStats
	runtime.ReadMemStats(&mem)
	memUsage := float64(mem.Alloc) / (1024 * 1024)
	t.Logf("Memory usage for lengthOfLongestSubstring: %.4f MB", memUsage)
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published