我如何创建一个javascript setTimeout函数的条件 [英] How do i creat a conditon of a javascript setTimeout function

查看:73
本文介绍了我如何创建一个javascript setTimeout函数的条件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我会非常感激如果我能弄明白确定javascript setTimeout函数的空闲时间,也就是说,我想在if语句中使用它作为条件,如果空闲或不评估到布尔值true或false,例如:



Hi all, I'll be so grateful If I could figure out to determine the idle time of javascript setTimeout function, that is, I want to use it in an "if statement" as a condition if idle or not evaluating to a boolean true or false, such as:

 if (setTimeout(iGotTheAnswerByMyself(), 7000000000000) { 
// do something if you get an answer before time is out
thankYourForAnsweringBeforeTimeOut();
}







非常感谢您提前付出的努力!




Thanks a lot for your efforts in advance!

推荐答案

这个问题很好的幽默,我很感激。



这大约是222年。我认为我不需要急于回答。我希望这一次足以让你阅读JavaScript文档。功能是它会如此简单太容易满足这个截止日期。并且有用数百倍。 :-)



祝你好运,

-SA
Nice humorous formulation of the question, I appreciate it.

This is about 222 years. I don't think I need to rush with the answer. I hope this time would be enough for you to read JavaScript documentation. The function is so simple that it will be too easy to meet this deadline. And hundreds of times more useful. :-)

Good luck,
—SA


这篇关于我如何创建一个javascript setTimeout函数的条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆