合规国际互联网加速 OSASE为企业客户提供高速稳定SD-WAN国际加速解决方案。 广告
Banchmark === - 简单测试 ~~~ type datamodel struct { Host string `json:"host"` } func BenchmarkSquare(b *testing.B) { b.ResetTimer() for i:=0;i<b.N;i++{ //测试代码 //data :=`{"host":"123456"}` //d := &datamodel{} //json.Unmarshal([]byte(data),d) d := &datamodel{ Host:"1212312", } json.Marshal(d) } b.StopTimer() } ~~~