# Tag event script and ClockDriftDetector error

**URL:** <https://forum.inductiveautomation.com/t/tag-event-script-and-clockdriftdetector-error/10817>\
**Category:** Ignition\
**Created:** [November 23, 2015, 1:17pm UTC](https://forum.inductiveautomation.com/t/tag-event-script-and-clockdriftdetector-error/10817 "2015-11-23T13:17:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MoisesZV](https://avatars.discourse-cdn.com/v4/letter/m/e68b1a/32.png) [@MoisesZV](https://forum.inductiveautomation.com/u/MoisesZV)\
**Post date:** [November 23, 2015, 1:17pm UTC](https://forum.inductiveautomation.com/t/tag-event-script-and-clockdriftdetector-error/10817/1 "2015-11-23T13:17:56Z")

</div>

Hi, I have a Tag event script for a group of tags. This tag event script writes to the database when the values of the tags changes, but sometimes I get a Clock drift error in the console

```auto
Clock drift, degraded performance, or pause-the-world detected. lastTime=Fri Nov 20 15:34:42 ART 2015 currentTime=Fri Nov 20 15:34:44 ART 2015 deviation from expected 1000ms delta=1145ms.
```

This clockdrift error is causing my tag event script to execute and write to the database when it should not, I think this happen because the tags lose the connection briefly and when reconnect the script take it like a value change.

My question is, is there a way to not execute the script when lose the connection? or maybe a way to don’t get a Clockdrift error?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [November 23, 2015, 2:01pm UTC](https://forum.inductiveautomation.com/t/tag-event-script-and-clockdriftdetector-error/10817/2 "2015-11-23T14:01:46Z")

</div>

The first thing to check here is the pause-the-world possibility, even though it’s last in the list of possibilities. I suspect this isn’t java8 – its defaults are much more resistant to this problem. You might want to look at [this topic](https://inductiveautomation.com/forum/viewtopic.php?f=50&t=14329).

---

<div class="post-metadata">

**Author:** ![MoisesZV](https://avatars.discourse-cdn.com/v4/letter/m/e68b1a/32.png) [@MoisesZV](https://forum.inductiveautomation.com/u/MoisesZV)\
**Post date:** [November 23, 2015, 2:12pm UTC](https://forum.inductiveautomation.com/t/tag-event-script-and-clockdriftdetector-error/10817/3 "2015-11-23T14:12:12Z")

</div>

I have java 8 updated, my PC is 32 bits 4gb ram. I have a lot of clockdrift error through the day.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [November 23, 2015, 3:17pm UTC](https://forum.inductiveautomation.com/t/tag-event-script-and-clockdriftdetector-error/10817/4 "2015-11-23T15:17:01Z")

</div>

[quote=“MoisesZV”]I have java 8 updated, my PC is 32 bits 4gb ram. I have a lot of clockdrift error through the day.[/quote]It might just be too little ram. Less ram for java =\> more garbage collection events.  
The recommendations I pointed at include the garbage collection diagnostics that will tell you how long your pause-the-world events are. Please adjust your wrapper configuration accordingly. Then show the log entries leading up to and after (say, +/- 30 minutes) of each of your clock drift errors.  
Also, consider googling “java pause the world” to get some background on the issue.
