|
Kyle Lemons |
at Nov 11, 2013 at 6:00 pm
|
⇧ |
| |
If you start your function with something like
start := time.Now()
defer func() {
runTime := time.Since(start)
// now you can use runTime, which should have the lifetime of the
goroutine
log.Printf("Write ran for %s", runTime)
}()
you can tell how long the "body" of the function ran according to your
computer's system clock (with all of the caveats that entails).
On Thu, Nov 7, 2013 at 11:50 PM, Long Yang wrote:Hi all,
I'm working on high concurrency socket programming,
on the read/write,some goroutines sleep.
how can i get the real execution time of thes goroutines?
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit
https://groups.google.com/groups/opt_out. --
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit
https://groups.google.com/groups/opt_out.