---
title: "size(ofCounterHeapEntry:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtldevice/size(ofcounterheapentry:)"
---

# size(ofCounterHeapEntry:)

Returns the size, in bytes, of each entry in a counter heap of a specific counter heap type when your app resolves it into a usable format.

## Declaration

```swift
func size(ofCounterHeapEntry type: MTL4CounterHeapType) -> Int
```

## Parameters

- `type`: doc://com.apple.metal/documentation/Metal/MTL4CounterHeapType value that represents the type of the doc://com.apple.metal/documentation/Metal/MTL4CounterHeap to resolve.

## Return Value

Return Value The size of the post-transformation entry from a MTL4CounterHeap of type MTL4CounterHeapType.

## Discussion

Discussion In order to use the data available in a MTL4CounterHeap, your app first resolves it either in the CPU timeline or in the GPU timeline. When your app calls resolveCounterHeap:withRange:intoBuffer:waitFence:updateFence: to resolve counter data in the GPU timeline, Metal writes the data into a MTLBuffer. During this process, Metal transform the data in the heap into a format consisting of entries of the size that this method advertises, based on the MTL4CounterHeapType.
