# Strange problem with "while loop"

**URL:** <https://forum.kirupa.com/t/strange-problem-with-while-loop/172607>\
**Category:** Uncategorized\
**Created:** [December 16, 2005, 2:24am UTC](https://forum.kirupa.com/t/strange-problem-with-while-loop/172607 "2005-12-16T02:24:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gokhan](https://avatars.discourse-cdn.com/v4/letter/g/7993a0/32.png) [@gokhan](https://forum.kirupa.com/u/gokhan)\
**Post date:** [December 16, 2005, 2:24am UTC](https://forum.kirupa.com/t/strange-problem-with-while-loop/172607/1 "2005-12-16T02:24:24Z")

</div>

In a game, I want to show hints appear on the screen for 100 miliseconds.  
What is wrong with this function? “txt.\_visible=true” line never executes.

```auto
txt._visible = false;
btn.onPress = showHint;
function showHint() {
t = getTimer();
while ((getTimer()-t)<100) {
txt._visible = true;
}
txt._visible = false;
} 

```
