# Accuracy difference between getTimer and date.getTime

**URL:** <https://forum.kirupa.com/t/accuracy-difference-between-gettimer-and-date-gettime/269598>\
**Category:** Uncategorized\
**Created:** [August 29, 2008, 10:21am UTC](https://forum.kirupa.com/t/accuracy-difference-between-gettimer-and-date-gettime/269598 "2008-08-29T10:21:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wocker](https://avatars.discourse-cdn.com/v4/letter/w/4da419/32.png) [@Wocker](https://forum.kirupa.com/u/Wocker)\
**Post date:** [August 29, 2008, 10:21am UTC](https://forum.kirupa.com/t/accuracy-difference-between-gettimer-and-date-gettime/269598/1 "2008-08-29T10:21:10Z")

</div>

[INDENT]I came accross another issue regarding the accuracy between the getTimer and date.getTime functions.  
I use this simple script (AS2)

```php

stop();

//START TIMER
var tObj:Object = new Object();
tObj.startDate = new Date();
tObj.startDateTime = tObj.startDate.getTime();
tObj.startTimer = getTimer();

var gTimerID:Number;
gTimerID = setInterval(this, "checkT", 100);

 function checkT() {
    tObj.msTimer = getTimer()-tObj.startTimer;
    var my_date:Date = new Date();
    tObj.msDateTimer = my_date.getTime() - tObj.startDateTime;
    tObj.diffTime = Math.abs(tObj.msTimer-tObj.msDateTimer);
    trace("difference:"+tObj.diffTime);
}

```

What happens if you let this simple app running is that the trace will show that the difference between the getTimer and date.getTime results slowly increases.  
I would assume some inaccuracy, but not one that would slowly increase during the lifetime of the application.  
The reason I want to compare the two values is that I want to see if someone is tampering with the application speed with a program such as Cheat Engine. And I noticed the date.getTime function isn’t affected by that program, but the getTimer function is.  
[/INDENT]
