# Set USRP clock to system time in GRC

**URL:** <https://www.ruby-forum.com/t/set-usrp-clock-to-system-time-in-grc/227991>\
**Category:** GNU Radio\
**Created:** [April 5, 2013, 5:07pm UTC](https://www.ruby-forum.com/t/set-usrp-clock-to-system-time-in-grc/227991 "2013-04-05T17:07:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![raven13](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b3f665/32.png) [@raven13](https://www.ruby-forum.com/u/raven13)\
**Post date:** [April 5, 2013, 5:07pm UTC](https://www.ruby-forum.com/t/set-usrp-clock-to-system-time-in-grc/227991/1 "2013-04-05T17:07:28Z")

</div>

Hi list,

I am wondering if it is possible to set a USRP clock to the system time  
within GRC. I know this is straightforward in Python and C++ using the  
set\_time\_now method, but as I use GRC a lot I don’t want to edit the  
generated python files everytime after I do some changes to my  
flowgraph.

I already checked the source (master a few weeks old) but there seems to  
be no call of set\_time\_now or set\_time\_next\_pps. (I believe there have  
been no patches the last weeks regarding this?)

If there is no way of doing this in GRC right now, is there any reason  
not  
to add this to the UHD sink/source to set the clocks to system time by  
default?

Have a nice weekend.  
Yours  
Martin L.

---

<div class="post-metadata">

**Author:** ![raven13](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b3f665/32.png) [@raven13](https://www.ruby-forum.com/u/raven13)\
**Post date:** [April 5, 2013, 6:52pm UTC](https://www.ruby-forum.com/t/set-usrp-clock-to-system-time-in-grc/227991/2 "2013-04-05T18:52:10Z")

</div>

On 04/05/2013 10:05 AM, Martin L. wrote:

> If there is no way of doing this in GRC right now, is there any reason not  
> to add this to the UHD sink/source to set the clocks to system time by  
> default?

I can see that being a helpful option.

Can you try this diff? It added a PC clock option to the sync drop down.  
When set, the set\_time\_now will be initialized approximately to the PC’s  
time (pythons time.time() call).

> <https://pastebin.com/BmNeLzb1>

-josh
