# nanoseconds

**URL:** <https://forums.digi.com/t/nanoseconds/5932>\
**Category:** NET+OS\
**Created:** [December 6, 2004, 10:31am UTC](https://forums.digi.com/t/nanoseconds/5932 "2004-12-06T10:31:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/digi/original/1X/11da31a6a1fbcd03ef21d3f785c317c824009ae2.png) [@system](https://forums.digi.com/u/system)\
**Post date:** [December 6, 2004, 10:31am UTC](https://forums.digi.com/t/nanoseconds/5932/1 "2004-12-06T10:31:43Z")

</div>

I want to send out one bit on the serial port with the precision in nanoseconds. Is there any functions similar to QueryPerformanceCounter() and QueryPerformanceFrequency() in windows? I use the NAgetCpuClkFreq() as I want to get the Frequency of the CPU. I can’t use the NATotalTicks(), since it is non-accurate. any ideas ? // Dan

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/digi/original/1X/11da31a6a1fbcd03ef21d3f785c317c824009ae2.png) [@system](https://forums.digi.com/u/system)\
**Post date:** [December 21, 2004, 6:53am UTC](https://forums.digi.com/t/nanoseconds/5932/2 "2004-12-21T06:53:34Z")

</div>

Only thing I can recommend is using the timer 2 using fast interrupt. Any other way you would not be able to come even close to that resolution, due to unwanted interrupts. And even with this approach i doubt nano seconds are possible. I havent tried using the timer 2 yet, so cant tell you what the highest possible accuracy is though

---

<div class="post-metadata">

**Author:** ![pevandenburie](https://avatars.discourse-cdn.com/v4/letter/p/7feea3/32.png) [@pevandenburie](https://forums.digi.com/u/pevandenburie)\
**Post date:** [August 29, 2006, 4:39pm UTC](https://forums.digi.com/t/nanoseconds/5932/3 "2006-08-29T16:39:40Z")

</div>

Hi,  
Have you tried the fast interrupt on DIGI Connect EM on ME? It seems that it is not available on NS7520 but I cannot have a confirmation.

Paul
