How do I make a template pause(sleep)?

There is no native sleep or pause function in CFML. But with CFMX you can easily leverage Java and take advantage of Java's sleep function. The following code snippet will sleep for 1,000 milliseconds (one second) between calls to getTickCount().

Before Sleep: #getTickCount()#<br>
  go_to = createObject("java", "java.lang.Thread");
  go_to.sleep(1000); //sleep time in milliseconds
After Sleep: #getTickCount()#

This question was written by Steve Gustafson
It was last updated on February 22, 2006.




comments powered by Disqus