And you could also use the timeit module (
http://docs.python.org/library/timeit.html):
"""
import timeit
print timeit.Timer('"喔喔".decode("utf-8")').timeit()
"""

On Fri, May 13, 2011 at 2:48 AM, Brandon Wirtz <drak...@digerat.com> wrote:

> Add 50 characters and double your loop amount.   You aren't pushing it hard
> enough that you get an accurate number.
>
>
>
> -----Original Message-----
> From: google-appengine@googlegroups.com [mailto:
> google-appengine@googlegroups.com] On Behalf Of ??
> Sent: Friday, May 13, 2011 2:07 AM
> To: Google App Engine
> Subject: [google-appengine] B8 vs B4 vs B2 vs B1 , B8 = B4 ?
>
> def test(i = 1000000):
>        t = datetime.datetime.now()
>        while i:
>                i -= 1
>                '喔喔'.decode('utf-8')
>        print datetime.datetime.now()-t
>
> test()
>
>
> B8 time: 0:00:01.520756
>
> B4 time: 0:00:01.524307
>
> B2 time: 0:00:02.342202
>
> B1 time: 0:00:03.492686
>
>
> B8 = B4 ?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To post to this group, send email to google-appengine@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To post to this group, send email to google-appengine@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to