# Bug/Problem with setTimeout function

**URL:** <https://forum.ionicframework.com/t/bug-problem-with-settimeout-function/103480>\
**Category:** ionic-v3\
**Created:** [August 28, 2017, 4:58pm UTC](https://forum.ionicframework.com/t/bug-problem-with-settimeout-function/103480 "2017-08-28T16:58:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zahema](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/zahema/32/111660_2.png) [@Zahema](https://forum.ionicframework.com/u/Zahema)\
**Post date:** [August 28, 2017, 4:58pm UTC](https://forum.ionicframework.com/t/bug-problem-with-settimeout-function/103480/1 "2017-08-28T16:58:49Z")

</div>

I know the title seems weird but hear me out.

- I am using `setTimeout()` to keep track of some user events -like scroll ending-, which worked as expected (executed a function after a set time of milliseconds).
- A few days ago I updated my device WebView to the latest version. Immediately after the function stopped working correctly.

**Problem description:**  
`setTimeout()` always wait for about an extra second despite what ever time I set.

**How to reproduce:**  
To clarify more here the same code I run on an app created by ionic cli (typescript)and another by cordova cli (javascript):

```auto
console.log('Timer Start');
let timeOutHandler = setTimeout(
    ()=>{
        console.log('Timer End');
    },
    100
);

```

- Here is the ionic app console output:  

- Here is the cordova app console output:  

**Notes:**

- I tested the function in different parts/pages of the app.
- I tested on 3 android devices with the same results.
- The problem only appears in the latest WebView update (maybe slightly earlier updates too).
- The tests where done in blank apps.
- Of course the code above was written by JavaScript for the cordova app.

## I am looking for any explanation on why and how does this happen? And if there is any workarounds?

## Thank you.

As a final note, here is my ionic info (for the blank app):

```auto
cli packages:

    @ionic/cli-utils : 1.6.0 (C:\Users\iaboelsuod\AppData\Roaming\npm\node_modules\ionic\node_modules\@ionic\cli-utils)
    ionic (Ionic CLI) : 3.6.0 (C:\Users\iaboelsuod\AppData\Roaming\npm\node_modules\ionic)

System:

    Android SDK Tools : 26.0.2
    Node : v6.11.0
    OS : Windows 10
    npm : 3.10.10

```

I don’t think it’s related but I added just in case.
