Code Monkey home page Code Monkey logo

Comments (7)

GoogleCodeExporter avatar GoogleCodeExporter commented on September 4, 2024
I had actually thought about this issue. The only problem is incurring a call 
for time.time() in every step. I'll see if that can be avoided (maybe using an 
alarm, or a secondary thread), but it might even not be worth it.

Original comment by [email protected] on 3 Aug 2010 at 5:13

  • Added labels: Priority-High
  • Removed labels: Priority-Medium

from python-progressbar.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 4, 2024
+1, maybe ETA can be used to determine number of updates required for smooth 
operation?

Original comment by [email protected] on 14 Dec 2010 at 3:14

from python-progressbar.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 4, 2024
I'm not convinced that calling `time.time()` is a large problem

From IPython
In [1]: import time
In [2]: %timeit time.time()
1000000 loops, best of 3: 269 ns per loop

Original comment by Wolphie on 14 Dec 2010 at 3:28

from python-progressbar.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 4, 2024
Interesting. It's a bit slower in the machine I'm using right now:

In [22]: %timeit pbar._need_update()
timeit1000000 loops, best of 3: 617 ns per loop

In [23]: %timeit time.time()
1000000 loops, best of 3: 1.37 µs per loop

Adding a call to time.time() in _need_update() increases the time of a single 
call to:

In [54]: %timeit pbar._need_update()
100000 loops, best of 3: 2.31 µs per loop

Original comment by [email protected] on 14 Dec 2010 at 10:01

from python-progressbar.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 4, 2024
Still doesn't look like a large enough amount to worry about. If you're 
actually running updates on the progress bar more than 432,900 times per second 
than you've got a different problem ;)

Original comment by Wolphie on 14 Dec 2010 at 10:08

from python-progressbar.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 4, 2024
Done in 
https://code.google.com/p/python-progressbar/source/detail?r=a00c6b7ca3c5a1cd7c3
8386e91bffde086607e3d

Please check if it's OK, if you can. Thanks.

Original comment by [email protected] on 15 Dec 2010 at 3:30

  • Changed state: Fixed

from python-progressbar.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 4, 2024
It's working perfectly. Great patch!

Original comment by Wolphie on 16 Dec 2010 at 7:01

from python-progressbar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.