> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PartyManager::SetProfilingCallbacksForMethodEntryExit

> Optionally configures the profiling event callbacks the Party library will make when entering or exiting instrumented methods.

Optionally configures the profiling event callbacks the Party library will make when entering or exiting instrumented methods.

## Syntax

```cpp theme={null}
PartyError SetProfilingCallbacksForMethodEntryExit(  
    PartyProfilingMethodEntranceCallback profilingMethodEntranceCallback,  
    PartyProfilingMethodExitCallback profilingMethodExitCallback  
)  
```

### Parameters

**`profilingMethodEntranceCallback`**   [PartyProfilingMethodEntranceCallback](/services/playfab/multiplayer/networking/reference/callbacks/partyprofilingmethodentrancecallback)\
*optional*

The callback to be made when the Party library enters an internal method which is instrumented for profiling.

**`profilingMethodExitCallback`**   [PartyProfilingMethodExitCallback](/services/playfab/multiplayer/networking/reference/callbacks/partyprofilingmethodexitcallback)\
*optional*

The callback to be made when the Party library is about to exit an internal method which is instrumented for profiling.

### Return value

PartyError

`c_partyErrorSuccess` if the call succeeded or an error code otherwise. The human-readable form of the error code can be retrieved via [GetErrorMessage()](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_geterrormessage).

## Remarks

This method allows the title to install custom profiling callback functions in order to record and visualize Party library performance metrics in external profiling tools. <br /><br /> This method can only be called when the Party library is uninitialized. Calling while Party is initialized will fail and return an error.   <br /><br /> Setting an optional callback equal to `nullptr` will cause the Party library to not make any profiling callbacks for that event type.   <br /><br /> In order to minimize the impact of profiling on title performance, callbacks for these events should be kept as lightweight as possible, as they are expected to fire hundreds or thousands of times per second.   <br /><br /> This method is only supported on the Windows and Microsoft Game Core versions of the library. Calls on other platforms will fail.

## Requirements

**Header:** Party.h

## See also

[PartyManager](/services/playfab/multiplayer/networking/reference/classes/PartyManager/partymanager)\
[PartyProfilingMethodEntranceCallback](/services/playfab/multiplayer/networking/reference/callbacks/partyprofilingmethodentrancecallback)\
[PartyProfilingMethodExitCallback](/services/playfab/multiplayer/networking/reference/callbacks/partyprofilingmethodexitcallback)\
[PartyManager::GetProfilingCallbacksForMethodEntryExit](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_getprofilingcallbacksformethodentryexit)


## Related topics

- [PartyManager::GetProfilingCallbacksForMethodEntryExit](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_getprofilingcallbacksformethodentryexit.md)
- [PartyProfilingMethodExitCallback](/services/playfab/multiplayer/networking/reference/callbacks/partyprofilingmethodexitcallback.md)
- [PartyProfilingMethodEntranceCallback](/services/playfab/multiplayer/networking/reference/callbacks/partyprofilingmethodentrancecallback.md)
- [PlayFab Party Release Notes](/services/playfab/multiplayer/networking/release-notes.md)
- [PartyXblManager::SetProfilingCallbacksForMethodEntryExit](/services/playfab/multiplayer/networking/xblreference/classes/PartyXblManager/methods/partyxblmanager_setprofilingcallbacksformethodentryexit.md)
