~themue/juju-core/053-env-more-script-friendly

« back to all changes in this revision

Viewing changes to utils/timeit.go

Merge trunk and resolve conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
package trivial
 
1
package utils
2
2
 
3
3
import (
4
4
        "fmt"
26
26
 
27
27
// Start a timer, used for tracking time spent.
28
28
// Generally used with either defer, as in:
29
 
//  defer trivial.Timeit("my func")()
 
29
//  defer utils.Timeit("my func")()
30
30
// Which will track how much time is spent in your function. Or
31
31
// if you want to track the time spent in a function you are calling
32
32
// then you would use:
33
 
//  toc := trivial.Timeit("anotherFunc()")
 
33
//  toc := utils.Timeit("anotherFunc()")
34
34
//  anotherFunc()
35
35
//  toc()
36
36
// This tracks nested calls by indenting the output, and will print out the