<!--
{
  "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",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "os"
    ],
    "preciseIdentifier" : "s:2os12OSSignposterV"
  },
  "title" : "OSSignposter"
}
-->

# OSSignposter

An object for measuring task performance using the unified logging system.

```
struct OSSignposter
```

## Overview

Signposts allow you to record meaningful information about the duration of your app’s tasks using the same subsystems and categories that you use for logging. Use `OSSignposter` to create signposted intervals in your code, and then use Instruments’ `os_signposts` instrument to record those intervals as you run your app and perform the actions to measure. Instruments displays signpost data visually in a timeline.

![An image that shows several signposted intervals on a timeline in Instruments. The first interval has a highlight and displays the OS signpost icon at its start and end. The icons represent the calls in code that begin and end the signposted interval.](images/com.apple.os/media-3855979@2x.png)

To add a signposted interval, create a signpost ID — an identifier that disambiguates intervals that have the same name, subsystem, and category, and that exist within the same scope — and then add a call to one of the class’s `beginInterval` methods just before the code you want to measure. Retain the interval state it returns, and end the interval by passing that state to one of the class’s `endInterval` methods, which you call immediately after the measured code. A signposter uses interval state to enforce a number of runtime assertions, the behavior of which depends on your app’s build configuration. For more information, see [`OSSignpostIntervalState`](/documentation/os/OSSignpostIntervalState). A signposted interval consists of one begin call and one end call only.

`OSSignposter` also provides functionality to signpost a closure, and to emit individual signposts that don’t have a duration that you can use to highlight points of interest, such as when the user taps a button or performs a specific gesture.

## Topics

### Creating a Signposter

[`init()`](/documentation/os/OSSignposter/init())

Creates a signposter that uses the default subsystem.

[`init(subsystem:category:)`](/documentation/os/OSSignposter/init(subsystem:category:)-94xpb)

Creates a signposter that uses the specified subsystem and category.

[`init(subsystem:category:)`](/documentation/os/OSSignposter/init(subsystem:category:)-4vdri)

Creates a signposter that uses the specified subsystem and system-defined log category.

[`init(logger:)`](/documentation/os/OSSignposter/init(logger:))

Creates a signposter that uses the subsystem and category of an existing logger.

[`init(logHandle:)`](/documentation/os/OSSignposter/init(logHandle:))

Creates a signposter that uses the subsystem and category of an existing log.

[`disabled`](/documentation/os/OSSignposter/disabled)

A shared signposter that doesn’t emit signposts at runtime.

### Getting State

[`isEnabled`](/documentation/os/OSSignposter/isEnabled)

A Boolean value that indicates whether the signposter can emit signposts.

### Generating Signpost IDs

[`makeSignpostID()`](/documentation/os/OSSignposter/makeSignpostID())

Returns an identifier that’s unique within the scope of the signposter.

[`makeSignpostID(from:)`](/documentation/os/OSSignposter/makeSignpostID(from:))

Returns an identifier that the signposter derives from the specified object.

[`OSSignpostID`](/documentation/os/OSSignpostID)

An identifier that disambiguates signposted intervals.

### Starting a Signposted Interval

[`beginInterval(_:id:)`](/documentation/os/OSSignposter/beginInterval(_:id:))

Begins a signposted interval.

[`beginInterval(_:id:_:)`](/documentation/os/OSSignposter/beginInterval(_:id:_:))

Begins a signposted interval and attaches the specified message.

[`beginAnimationInterval(_:id:)`](/documentation/os/OSSignposter/beginAnimationInterval(_:id:))

Begins a signposted interval for measuring an animation.

[`beginAnimationInterval(_:id:_:)`](/documentation/os/OSSignposter/beginAnimationInterval(_:id:_:))

Begins a signposted interval for measuring an animation, and attaches a message.

[`OSSignpostIntervalState`](/documentation/os/OSSignpostIntervalState)

An object that tracks the state of a signposted interval.

[`SignpostMetadata`](/documentation/os/SignpostMetadata)

The type that represents a message you attach to a signpost.

### Stopping a Signposted Interval

[`endInterval(_:_:)`](/documentation/os/OSSignposter/endInterval(_:_:))

Ends the signposted interval that corresponds to the specified name and state.

[`endInterval(_:_:_:)`](/documentation/os/OSSignposter/endInterval(_:_:_:))

Ends a signposted interval and attaches the specified message.

### Measuring a Closure

[`withIntervalSignpost(_:id:around:)`](/documentation/os/OSSignposter/withIntervalSignpost(_:id:around:))

Measures the execution of the specified closure.

[`withIntervalSignpost(_:id:_:around:)`](/documentation/os/OSSignposter/withIntervalSignpost(_:id:_:around:))

Measures the execution of a closure and attaches the specified message.

### Emitting Individual Signposts

[`emitEvent(_:id:)`](/documentation/os/OSSignposter/emitEvent(_:id:))

Marks a point of interest in time.

[`emitEvent(_:id:_:)`](/documentation/os/OSSignposter/emitEvent(_:id:_:))

Marks a point of interest in time and attaches the specified message.

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

---

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)