## General-Timing

### Function Introduction

- Timing Classification:
- Cloud Timing
  - Scope of Use: Use with a gateway or wifi device
  - Application Scenarios: Use with a gateway, the overall experience is good, and the App can notify the user after the timing is executed.
  - Advantages and Disadvantages:
    - Advantages:
      - App reminder function
    - Allows remote operation of timing
    - Disadvantages:
      - If the network is disconnected, the timing cannot be executed
- Local Timing
  - Scope of Use: Devices without a gateway, generally used for sigmesh or single-point Bluetooth devices (complete DP protocol description) or Beacon devices (22.2 Beacon complete DP protocol description)
  - Application Scenarios: Mainly in the absence of a gateway, Tuya Cloud timing cannot work properly. If the timing capability is needed at this time, local timing is required. After the timing is set on the client, the timing dp is sent to the device, and the subsequent timing logic is executed locally on the device side without the gateway.
  - Advantages and Disadvantages:
    - Advantages:
      - Can still be executed after disconnection, high stability
    - Disadvantages:
      - If there is no gateway, you need to connect directly to the mobile phone

### How to develop

- If the device supports cloud timing
  - Method 1, you can directly call [Mini Program Module Component](https://developer.tuya.com/material/library_oHEKLjj0/component?code=LampModuleSchedule) to implement.
    - Advantages: Support theme modification;
    - Disadvantages: Need to define the input component parameters to implement
  - Method 2, you can directly call [Schedule Function Page](https://developer.tuya.com/material/library_oHEKLjj0/component?code=LampScheduleFunctional) to implement.
    - Advantages: fast implementation of functions;
    - Disadvantages: does not support theme modification
  - Method 3, self-implementation, relying on the cloud timing addition, deletion, modification and query interface:
    - [Add timing](/en/miniapp/develop/miniapp/api/timer/base/addTimer)
    - [Update timing](/en/miniapp/develop/miniapp/api/timer/base/updateTimer)
    - [Delete timing](/en/miniapp/develop/miniapp/api/timer/base/removeTimer)
    - [Update status](/en/miniapp/develop/miniapp/api/timer/base/updateTimerStatus)
    - [Synchronize timing](/en/miniapp/develop/miniapp/api/timer/base/syncTimerTask)

### Notes

None

### Related materials

- [Function page]:
  1. [Schedule function page](https://developer.tuya.com/material/library_oHEKLjj0/component?code=LampScheduleFunctional)
- [Component]:
  1. [Schedule component](https://developer.tuya.com/material/library_oHEKLjj0/component?code=ComponentsTyLamp&subCode=LampModuleSchedule)
- [Tutorial]:
  - None
- [SDK]:
  - None
- [API]:
  - None
