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

# scheduledTimer(timeInterval:target:selector:userInfo:repeats:)

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

```
class func scheduledTimer(timeInterval ti: TimeInterval, target aTarget: Any, selector aSelector: Selector, userInfo: Any?, repeats yesOrNo: Bool) -> Timer
```

## Parameters

`ti`

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

`aTarget`

The object to which to send the message specified by `aSelector` when the timer fires. The timer maintains a strong reference to `target` until it (the timer) is invalidated.

`aSelector`

The message to send to `target` when the timer fires.

    The selector should have the following signature:     `timerFireMethod:`     (including a colon to indicate that the method takes an argument). The timer passes itself as the argument, thus the method would adopt the following pattern:

```objc
- (void)timerFireMethod:(NSTimer *)timer
```

`userInfo`

The user info for the timer. The timer maintains a strong reference to this object until it (the timer) is invalidated. This parameter may be `nil`.

`yesOrNo`

If <doc://com.apple.documentation/documentation/Swift/true>, the timer will repeatedly reschedule itself until invalidated. If <doc://com.apple.documentation/documentation/Swift/false>, the timer will be invalidated after it fires.

## Return Value

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

## Discussion

After `ti` seconds have elapsed, the timer fires, sending the message `aSelector` to `target`.

---

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)