<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "os",
  "identifier" : "/documentation/os/OSSignposter/emitEvent(_:id:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "os"
    ],
    "preciseIdentifier" : "s:2os12OSSignposterV9emitEvent_2idys12StaticStringV_AA12OSSignpostIDVtF"
  },
  "title" : "emitEvent(_:id:)"
}
-->

# emitEvent(_:id:)

Marks a point of interest in time.

```
func emitEvent(_ name: StaticString, id: OSSignpostID = .exclusive)
```

## Parameters

`name`

The event’s name.

`id`

The event’s identifier. The default value is [`exclusive`](/documentation/os/OSSignpostID/exclusive).

## Discussion

You can use the [`makeSignpostID()`](/documentation/os/OSSignposter/makeSignpostID()) and [`makeSignpostID(from:)`](/documentation/os/OSSignposter/makeSignpostID(from:)) methods to generate an identifier for the event, as the following example shows:

```swift
// Create a signposter using the default subsystem.
let signposter = OSSignposter()
        
// Generate a signpost ID to associate with the event.
let signpostID = signposter.makeSignpostID()
        
// Emit a named event using the signpost ID.
signposter.emitEvent("Example Event", id: signpostID)
```

---

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)