<!--
{
  "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/init(fire:interval:repeats:block:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSTimer(im)initWithFireDate:interval:repeats:block:"
  },
  "title" : "init(fire:interval:repeats:block:)"
}
-->

# init(fire:interval:repeats:block:)

Initializes a timer for the specified date and time interval with the specified block.

```
convenience init(fire date: Date, interval: TimeInterval, repeats: Bool, block: @escaping @Sendable (Timer) -> Void)
```

## Parameters

`date`

The time at which the timer should first fire.

`interval`

For a repeating timer, this parameter contains 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 <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.

`block`

A block to be executed when the timer fires. The block takes a single [`Timer`](/documentation/Foundation/Timer) parameter and has no return value.

## Return Value

A new [`Timer`](/documentation/Foundation/Timer) object, configured according to the specified parameters.

## Discussion

You must add the new timer to a run loop, using [`add(_:forMode:)`](/documentation/Foundation/RunLoop/add(_:forMode:)-392ag). Upon firing, after `interval` seconds have elapsed, the timer fires, executing `block`. (If the timer is configured to repeat, you don’t need to add the timer to the run loop again.)

---

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)