blob: 3dcc5e0bcb2b56a62869b104403478c55d63cfbb [file] [log] [blame]
Herbie Ong17523eb2019-03-29 17:46:57 -07001// Copyright 2019 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5package jsonpb_test
6
7import (
8 "testing"
9
Damien Neile89e6242019-05-13 23:55:40 -070010 "google.golang.org/protobuf/encoding/jsonpb"
11 knownpb "google.golang.org/protobuf/types/known"
Herbie Ong17523eb2019-03-29 17:46:57 -070012)
13
14func BenchmarkUnmarshal_Duration(b *testing.B) {
15 input := []byte(`"-123456789.123456789s"`)
16
17 for i := 0; i < b.N; i++ {
18 err := jsonpb.Unmarshal(&knownpb.Duration{}, input)
19 if err != nil {
20 b.Fatal(err)
21 }
22 }
23}