# Get current time

**URL:** <https://forum.universal-robots.com/t/get-current-time/186>\
**Category:** URScript\
**Created:** [August 19, 2016, 1:43pm UTC](https://forum.universal-robots.com/t/get-current-time/186 "2016-08-19T13:43:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon67860743](https://avatars.discourse-cdn.com/v4/letter/a/13edae/32.png) [@anon67860743](https://forum.universal-robots.com/u/anon67860743)\
**Post date:** [August 19, 2016, 1:43pm UTC](https://forum.universal-robots.com/t/get-current-time/186/1 "2016-08-19T13:43:30Z")

</div>

Hi!  
Is there anyway to get the time from the robot?  
For example to measure how long a time a thing takes or to do things at specified interval.

---

<div class="post-metadata">

**Author:** ![anon15006688](https://avatars.discourse-cdn.com/v4/letter/a/5f9b8f/32.png) [@anon15006688](https://forum.universal-robots.com/u/anon15006688)\
**Post date:** [August 19, 2016, 6:03pm UTC](https://forum.universal-robots.com/t/get-current-time/186/2 "2016-08-19T18:03:33Z")

</div>

Not sure this is what you mean, but it shows how to create a cycle timer.  
[http://www.universal-robots.com/how-tos-and-faqs/how-to/ur-how-tos/design-a-timer-function-15545/](http://www.universal-robots.com/how-tos-and-faqs/how-to/ur-how-tos/design-a-timer-function-15545/)

---

<div class="post-metadata">

**Author:** ![jbm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/jbm/32/614_2.png) [@jbm](https://forum.universal-robots.com/u/jbm)\
**Post date:** [August 22, 2016, 9:09am UTC](https://forum.universal-robots.com/t/get-current-time/186/3 "2016-08-22T09:09:10Z")

</div>

Hi Nils

The example @anon15006688 is a great option.  
Alternatively, if you in a thread place a `sync()` command, this will always return after 8 ms, hence you could have a timing loop where e.g. 125 sync’s will yield 1 second.

---

<div class="post-metadata">

**Author:** ![anon67860743](https://avatars.discourse-cdn.com/v4/letter/a/13edae/32.png) [@anon67860743](https://forum.universal-robots.com/u/anon67860743)\
**Post date:** [August 25, 2016, 4:45am UTC](https://forum.universal-robots.com/t/get-current-time/186/4 "2016-08-25T04:45:10Z")

</div>

Thanks medeiros and Jacob.  
This is exactly what I was after.  
Br  
Nils

---

<div class="post-metadata">

**Author:** ![dmytro.kharchenko](https://avatars.discourse-cdn.com/v4/letter/d/54ee81/32.png) [@dmytro.kharchenko](https://forum.universal-robots.com/u/dmytro.kharchenko)\
**Post date:** [July 2, 2025, 12:18pm UTC](https://forum.universal-robots.com/t/get-current-time/186/5 "2025-07-02T12:18:53Z")

</div>

I assume the link has moved to [Design a Timer Function](https://www.universal-robots.com/articles/ur/programming/design-a-timer-function/)
