<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSEvent/startPeriodicEvents(afterDelay:withPeriod:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSEvent(cm)startPeriodicEventsAfterDelay:withPeriod:"
  },
  "title" : "startPeriodicEvents(afterDelay:withPeriod:)"
}
-->

# startPeriodicEvents(afterDelay:withPeriod:)

Begins generating periodic events for the current thread.

```
class func startPeriodicEvents(afterDelay delay: TimeInterval, withPeriod period: TimeInterval)
```

## Parameters

`delay`

The number of seconds that `NSEvent` should wait before beginning to generate periodic events.

`period`

The period in seconds between the generated events.

## Discussion

Raises an `NSInternalInconsistencyException` if periodic events are already being generated for the current thread. This method is typically used in a modal loop while tracking mouse-dragged events.

---

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)