ui.util.setInterval
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
เรียกใช้ฟังก์ชันซ้ำๆ โดยมีระยะเวลาหน่วงคงที่ระหว่างการเรียกใช้แต่ละครั้ง
แสดงผลคีย์ที่ส่งไปยัง ui.util.clearTimeout เพื่อนำการหมดเวลาออกได้
การใช้งาน | การคืนสินค้า |
---|
ui.util.setInterval(func, delay) | ตัวเลข |
อาร์กิวเมนต์ | ประเภท | รายละเอียด |
---|
func | ฟังก์ชัน | ฟังก์ชันที่จะเรียกใช้หลังจากผ่านไประยะเวลาที่ระบุ |
delay | ตัวเลข | เวลาเป็นมิลลิวินาที (1/1000 ของวินาที) ที่ควรรอระหว่างการเรียกใช้ฟังก์ชันที่ระบุ |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\u003cp\u003e\u003ccode\u003eui.util.setInterval\u003c/code\u003e repeatedly executes a provided function at a fixed time interval.\u003c/p\u003e\n"],["\u003cp\u003eIt returns a unique key that can be used with \u003ccode\u003eui.util.clearTimeout\u003c/code\u003e to cancel the interval timer.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003edelay\u003c/code\u003e argument specifies the time in milliseconds between each function execution.\u003c/p\u003e\n"]]],["The core content describes the `ui.util.setInterval` function, which repeatedly executes a provided function (`func`) at a specified time interval (`delay`, in milliseconds). It returns a numerical key. This key is then usable with `ui.util.clearTimeout` to cancel the recurring function calls. The function establishes a recurring timer with the specified delay between executions.\n"],null,["# ui.util.setInterval\n\n\u003cbr /\u003e\n\nRepeatedly calls a function with a fixed time delay between each call.\n\n\u003cbr /\u003e\n\nReturns a key that can be passed to ui.util.clearTimeout to remove the timeout.\n\n| Usage | Returns |\n|------------------------------------|---------|\n| `ui.util.setInterval(func, delay)` | Number |\n\n| Argument | Type | Details |\n|----------|----------|------------------------------------------------------------------------------------------------------------------------------|\n| `func` | Function | The function to run after the specified delay. |\n| `delay` | Number | The time, in milliseconds (thousandths of a second), the timer should delay in between executions of the specified function. |"]]