Delaying SetTimeout()

Hi,
So I gotta this function in .ts and I want this timeout to be delayed by 1sec before going live, is it possible?

 ionViewDidLoad() {
    setTimeout(() => this.splash = false, 3500);
  }

… should be more like…

 ionViewDidLoad() {
    setTimeout(() => {
        this.splash = false
     }, 3500);
  }

Changing 3500 to 4500 would increase the duration of the delay by 1 second.

2 Likes

Thank you :slight_smile:

The time value in setTimeout is the delay in milliseconds.

2 Likes