<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/Timer/scheduledTimer(withTimeInterval:repeats:block:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSTimer(cm)scheduledTimerWithTimeInterval:repeats:block:"
  },
  "title" : "scheduledTimer(withTimeInterval:repeats:block:)"
}
-->

# scheduledTimer(withTimeInterval:repeats:block:)

Creates a timer and schedules it on the current run loop in the default mode.

```
class func scheduledTimer(withTimeInterval interval: TimeInterval, repeats: Bool, block: @escaping @Sendable (Timer) -> Void) -> Timer
```

## Parameters

`interval`

The number of seconds between firings of the timer. If `interval` is less than or equal to `0.0`, this method chooses the nonnegative value of `0.0001` seconds instead.

`repeats`

If `true`, the timer will repeatedly reschedule itself until invalidated. If `false`, the timer will be invalidated after it fires.

`block`

A block to be executed when the timer fires.

    The block takes a single     `NSTimer`     parameter and has no return value.

## Return Value

A new `NSTimer` object, configured according to the specified parameters.

## Discussion

After `interval` seconds have elapsed, the timer fires, executing `block`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)