<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLCommonCounter/init(rawValue:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "s:So16MTLCommonCountera8rawValueABSS_tcfc"
  },
  "title" : "init(rawValue:)"
}
-->

# init(rawValue:)

Creates a common counter name from a raw value.

```
init(rawValue: String)
```

## Parameters

`rawValue`

The name of a common counter as a string.

## Discussion

Use of the [`MTLCommonCounter`](/documentation/Metal/MTLCommonCounter) type’s static properties, such as [`timestamp`](/documentation/Metal/MTLCommonCounter/timestamp), [`computeKernelInvocations`](/documentation/Metal/MTLCommonCounter/computeKernelInvocations), or [`totalCycles`](/documentation/Metal/MTLCommonCounter/totalCycles) instead of creating a common counter instance yourself with this initializer.

---

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)