Light Speed Socket Connections

T Angell tangell at kicker.com
Thu Jul 12 16:46:33 CEST 2001


bokr at accessone.com (Bengt Richter) wrote in message news:<3b4d6184.1698299906 at wa.news.verio.net>...
> On 11 Jul 2001 22:32:16 -0700, tangell at kicker.com (T Angell) wrote:
> 
> >I wrote some code to test how long it takes to make socket connections
> >and ran it against several hosts around the world, here are some
> >sample times:
> >
> >socket time: 0.0047459602356
> >socket time: 0.00469899177551
> >socket time: 0.00404000282288
> >socket time: 0.00537407398224
> >
>  [...]
> >  t1 = time.time()
> For accurate timing, time.clock()
> is recommended, I believe:
> 
> """
> clock() 
>     Return the current CPU time as a floating point number expressed in seconds.
>     The precision, and in fact the very definition of the meaning of ``CPU time'',
>     depends on that of the C function of the same name, but in any case, this
>     is the function to use for benchmarking Python or timing algorithms. 
> """
> """
> time() 
>     Return the time as a floating point number expressed in seconds since the epoch,
>     in UTC. Note that even though the time is always returned as a floating point number,
>     not all systems provide time with a better precision than 1 second.
> """

Oh, of course. Thanks!



More information about the Python-list mailing list