🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
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() } ~~~