---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://yandex.com/dev/games/doc/en/sdk/construct-3/throttle-debounce.md
  - https://yandex.com/dev/games/doc/hi/sdk/construct-3/throttle-debounce.md
  - https://yandex.com/dev/games/doc/ko/sdk/construct-3/throttle-debounce.md
  - https://yandex.com/dev/games/doc/ru/sdk/construct-3/throttle-debounce.md
  - https://yandex.com/dev/games/doc/tr/sdk/construct-3/throttle-debounce.md
  - https://yandex.com/dev/games/doc/vi/sdk/construct-3/throttle-debounce.md
  - https://yandex.com/dev/games/doc/zh/sdk/construct-3/throttle-debounce.md
  - href: ko/sdk/construct-3/throttle-debounce.md
    type: text/markdown
    title: Markdown version
  - href: ../../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/dev/games/doc/ko/llms.txt

# Throttle 및 Debounce

이 플러그인은 두 가지 특별한 조건, **Not more than once in \<X\> seconds** 및 **On a deferred event**에 대한 접근을 제공합니다.

{% note info "참고" %}

Construct 3의 비주얼 프로그래밍 제한으로 인해 이러한 조건은 "가짜 루프"를 통해 구현되므로 이름 왼쪽에 루프 로고가 표시될 수 있습니다.

하지만 이는 루프가 아닌 조건입니다.

{% endnote %}

JavaScript를 사용하고자 한다면, 여러분은 다음 기사들을 참조할 수 있습니다: [검색 폼의 Debounce 예제](https://doka.guide/js/debounce/) 및 [스크롤 시 페이지 변경의 Throttle 예제](https://doka.guide/js/throttle/).

## Throttle

때때로 게임의 일부가 전체 성능에 강하게 영향을 미칠 수 있습니다. 예를 들어, 물리 처리나 인공지능 처리 등입니다.

이러한 복잡한 계산 때문에 너무 자주 사용하지 않는 것이 좋습니다. 이러한 경우에는 코드가 일정 시간마다 한 번 실행되도록 **Every \<X\> seconds**을 사용하는 것이 일반적이지만, 항상 가능한 것은 아닙니다.

예를 들어, 화면을 터치했을 때 실행되는 복잡한 게임 메커니즘이 있을 수 있습니다. 이럴 때 코드 실행 빈도를 제한해야 하며, 타이머를 사용할 수 없을 때 **Not more than once in \<X\> seconds** 조건을 사용할 수 있습니다.

{% note warning "경고" %}

매 프레임마다 **Not more than once in \<X\> seconds**을 사용하는 것은 권장되지 않으며, 대신 **Every \<X\> seconds**을 사용하는 것이 더 좋습니다.

![](../../_images/construct-3/throttle-debounce/throttle-vs-timer.png)

{% endnote %}

## Debounce

일부 Yandex Games SDK 메서드는 일정 시간 내 요청 수에 제한이 있습니다. 이 제한을 무시하면 게임이 심사를 통과하지 못할 수 있습니다.

예를 들어, 리더보드를 너무 자주 업데이트하는 경우 **On a deferred event** 조건을 사용하는 것이 좋습니다.

하지만, 이는 이전 조건인 **Not more than once in \<X\> seconds**과 혼동될 수 있습니다. 둘 다 너무 자주 호출되지 않아야 하는 코드를 감추기 위해 사용되지만, 어떤 차이가 있을까요?

주요 차이점은 **Not more than once in \<X\> seconds**이 호출 빈도를 제한하는 것이고, **On a deferred event**는 함수 호출을 일정 시간 연기하는 것입니다. 이는 리더보드에 점수를 전송하는 경우와 같이 너무 자주 실행할 필요는 없지만 제한을 초과해서는 안 됩니다.

**Not more than once in \<X\> seconds**와 **On a deferred event**의 차이점에 대한 시각화:

@[youtube](https://www.youtube.com/embed/gFpNtZ2lPM8?si=R3DgcZEtsShirW4n)

---


<!-- source: ko/_includes/button-git-construct.md -->
<a href="https://github.com/yandex-games-plugins/construct3">
  <span class="button">저장소</span>
</a>
<!-- endsource: ko/_includes/button-git-construct.md -->
