# OnStartup Timer \[Perspective\]

**URL:** <https://forum.inductiveautomation.com/t/onstartup-timer-perspective/32151>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [February 11, 2020, 10:41pm UTC](https://forum.inductiveautomation.com/t/onstartup-timer-perspective/32151 "2020-02-11T22:41:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaspinall](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@jaspinall](https://forum.inductiveautomation.com/u/jaspinall)\
**Post date:** [February 11, 2020, 10:41pm UTC](https://forum.inductiveautomation.com/t/onstartup-timer-perspective/32151/1 "2020-02-11T22:41:38Z")

</div>

Hello There,

Would anyone be able to tell me how I could accomplish the following:

I would like a component on my page to only become visible 5 seconds after the page has been loaded.

Is there a way to do this?

Many thanks

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [February 11, 2020, 10:55pm UTC](https://forum.inductiveautomation.com/t/onstartup-timer-perspective/32151/2 "2020-02-11T22:55:21Z")

</div>

- There are two ways to do this, and it depends on the whether the parent container of the component is Coordinate or Flex. If in a Flex container, set `Component.position.display` to a value of `false` (boolean). If in a Coordinate Container, set `Component.props.style.display` to a value of ‘none’ (string).

- In the onStartup Event of the View the component resides in:

```auto
system.perspective.sendMessage('FIVESECONDTIMER',scope='page')

```

- Then:

1. Right-click the component.
2. Select “Configure Scripts”.
3. Double Click “Add Handler…”
4. Set the Message Type input to “FIVESECONDTIMER”.
5. Leave the scope checkboxes alone.
6. Supply the following code for the script:

```auto
from time import sleep
sleep(5)
# Flex
self.props.display = True
# Coordinate
self.props.style.display = 'block'

```

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [February 11, 2020, 10:59pm UTC](https://forum.inductiveautomation.com/t/onstartup-timer-perspective/32151/3 "2020-02-11T22:59:09Z")

</div>

You should be aware that this will happen in the Designer as well, so if you work on the View, the Button will appear after five seconds. If you save the View while the button is visible, then it will be immediately visible in sessions, so you should apply similar logic to make the button invisible immediately in the View’s onStartup Event.

---

<div class="post-metadata">

**Author:** ![jaspinall](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@jaspinall](https://forum.inductiveautomation.com/u/jaspinall)\
**Post date:** [February 11, 2020, 11:09pm UTC](https://forum.inductiveautomation.com/t/onstartup-timer-perspective/32151/4 "2020-02-11T23:09:09Z")

</div>

Thank you for this info.

---

<div class="post-metadata">

**Author:** ![weertske](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/weertske/32/3353_2.png) [@weertske](https://forum.inductiveautomation.com/u/weertske)\
**Post date:** [February 15, 2020, 9:12pm UTC](https://forum.inductiveautomation.com/t/onstartup-timer-perspective/32151/5 "2020-02-15T21:12:20Z")

</div>

In the Vision world, we were always warned against using “sleep” within GUI scripts. Does Perspective handle this in a separate thread automatically?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [February 15, 2020, 9:15pm UTC](https://forum.inductiveautomation.com/t/onstartup-timer-perspective/32151/6 "2020-02-15T21:15:11Z")

</div>

It won’t hang the UI like in Vision but it’s still not a good idea. I would treat this suggestion as a quick hack at best.

---

<div class="post-metadata">

**Author:** ![weertske](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/weertske/32/3353_2.png) [@weertske](https://forum.inductiveautomation.com/u/weertske)\
**Post date:** [February 15, 2020, 10:03pm UTC](https://forum.inductiveautomation.com/t/onstartup-timer-perspective/32151/7 "2020-02-15T22:03:38Z")

</div>

I have a separate thread going about setting the value of checkboxes within a FlexRepeater. I have not been able to get the bools set to the value I want on view startup unless I delay running the script. Since a sleep delay is still not a good idea, what do you suggest to trigger my script?
