String returns a human-readable representation of the profile
()
| 26 | |
| 27 | // String returns a human-readable representation of the profile |
| 28 | func (p *Profile) String() string { |
| 29 | return fmt.Sprintf("[%s] %s: duration=%v, memory_delta=%+dB, lines=%d, bytes=%d", |
| 30 | p.Timestamp.Format("15:04:05.000"), |
| 31 | p.Operation, |
| 32 | p.Duration, |
| 33 | p.MemoryDelta, |
| 34 | p.LinesCount, |
| 35 | p.BytesCount, |
| 36 | ) |
| 37 | } |
| 38 | |
| 39 | func safeMemoryDelta(after, before uint64) int64 { |
| 40 | if after > math.MaxInt64 || before > math.MaxInt64 { |
no outgoing calls