# Re: Integration of python's time.time() and work() calls

**URL:** <https://www.ruby-forum.com/t/re-integration-of-pythons-time-time-and-work-calls/242125>\
**Category:** GNU Radio\
**Created:** [May 29, 2015, 4:31am UTC](https://www.ruby-forum.com/t/re-integration-of-pythons-time-time-and-work-calls/242125 "2015-05-29T04:31:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [May 29, 2015, 4:31am UTC](https://www.ruby-forum.com/t/re-integration-of-pythons-time-time-and-work-calls/242125/1 "2015-05-29T04:31:06Z")

</div>

> > Or is there a way to make sure that the in-buffer gets updated multiple  
> > times within the same work call?

Will placing the work function inside a while 1 do the trick? But I  
guess  
the issue with that is, as long as data is available, the scheduler  
calls  
work function again and again anyway.

I’m still a little muddled up about this. I have read a lot of the posts  
on  
the forum and the tutorials on the website as well.

Thanks for your time  
Anil

---

<div class="post-metadata">

**Author:** ![anil\_y](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/22d042/32.png) [@anil\_y](https://www.ruby-forum.com/u/anil_y)\
**Post date:** [May 29, 2015, 10:08am UTC](https://www.ruby-forum.com/t/re-integration-of-pythons-time-time-and-work-calls/242125/2 "2015-05-29T10:08:18Z")

</div>

Hi Anil,

On 05/29/2015 04:29 AM, Anil K. Yerrapragada wrote:

> > > Or is there a way to make sure that the in-buffer gets updated  
> > > multiple times within the same work call?
> 
> Will placing the work function inside a while 1 do the trick?  
> Never do that. Your job as GR user is to write the work() function. GNU  
> Radio will call it, whenever data is available. You can’t make data  
> appear faster than it appears, and you can rely on GR to call your  
> work() as soon as possible. Just don’t worry about doing this yourself.

Write your work() function in a manner that consumes as many items as it  
can whenever it’s called, and return exactly that number. GNU Radio will  
take care of the rest 🙂

> But I guess the issue with that is, as long as data is available, the  
> scheduler calls work function again and again anyway.  
> Indeed!
> 
> I’m still a little muddled up about this. I have read a lot of the  
> posts on the forum and the tutorials on the website as well.  
> GNU Radio’s primary job is to keep things simple for you: it allows  
> developers to just write their algorithms inside a work function. All  
> they have to do is take the input they get, generate the output they  
> want, and tell GNU Radio how much has been done.

Best regards,  
Marcus
