FAQ
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.

Search Discussions

  • 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.
  • RickyS at Nov 11, 2013 at 6:07 pm
    The 'testing' package has a Benchmark type.

    --
    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.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedNov 8, '13 at 7:50a
activeNov 11, '13 at 6:07p
posts3
users3
websitegolang.org

3 users in discussion

Long Yang: 1 post Kyle Lemons: 1 post RickyS: 1 post

People

Translate

site design / logo © 2021 Grokbase