DIFF

Enforce Script profiling API

WarningOnly available on developer and diag builds

Classes

Typedefs

EnProfilerCountClassPairParam2<int, typename>
EnProfilerCountFuncPairParam2<int, string>
EnProfilerTimeClassPairParam2<float, typename>
EnProfilerTimeFuncPairParam2<float, string>

Enums

Values

ALLAll flags enabled
CORE1_Core
DIAGScript profiling UI is enabled in WIN+ALT debug menu, when this is true, it will override SCRP
ERRORCan be returned from some methods
GAME3_Game
GAMELIB2_GameLib
MISSION5_Mission
MISSION_CUSTOMinit.c
NONE [1/2]No flags, has value 0, so will count as false in conditions
NONE [2/2]No flags
RECURSIVEWhether to profile child modules
RESETWhen present, will reset [PD] on sorting, otherwise will accumulate on top of it
SCRCWhether profiling is currently truly happening (SCRipt Context)
SCRPIt has been set to being always enabled through EnProfiler (SCRipt Profiler)
WORLD4_World

Functions

static proto int AddFlags(int flags, bool sessionReset = true)Add flags to the currently used set of EnProfilerFlags across the APImore…
static proto int ClearFlags(bool sessionReset = true)Remove all flags from the currently used set of EnProfilerFlags across the APImore…
static proto void Dump()Print out [SD] to script logmore…
static proto void Enable(bool enable, bool immediate = false, bool sessionReset = true)Enable the gathering of script profiling datamore…
static proto void EnableAverage(bool enable)Enable/disable returning calculated averagesmore…
static proto int GetAllocationsOfClass(typename clss, bool immediate = false)Obtain [SD] or [PD] regarding the allocations of a specific classmore…
static proto void GetAllocationsPerClass(notnull out array<ref EnProfilerCountClassPair> outArr, int count = int.MAX)Obtain [SD] for Allocations Per Classmore…
static proto int GetCountOfFunc(string funct, typename clss, bool immediate = false)Obtain [SD] or [PD] regarding the amount of times a specific function was calledmore…
static proto int GetCountOfFuncG(string funct, bool immediate = false)Obtain [SD] or [PD] regarding the amount of times a specific function was calledmore…
static proto void GetCountPerFunc(notnull out array<ref EnProfilerCountFuncPair> outArr, int count = int.MAX)Obtain [SD] for Count Per Functionmore…
static proto int GetFlags()Get the currently used flags across the APImore…
static proto int GetGameFrame()Get the total amount of frames passedmore…
static proto int GetInstancesOfClass(typename clss, bool immediate = false)Obtain [SD] or [PD] regarding the [CI] of a specific classmore…
static proto void GetInstancesPerClass(notnull out array<ref EnProfilerCountClassPair> outArr, int count = int.MAX)Obtain [SD] for Instances Per Classmore…
static proto int GetInterval()Get the currently set intervalmore…
static proto EnProfilerModule GetModule()Get the currently profiled modulemore…
static proto int GetProfiledFrames()Get the total amount of frames profiled across all profiling sessionmore…
static proto int GetProfiledSessionFrames()Get the total amount of frames profiled in this profiling sessionmore…
static proto int GetSessionFrame()Get the total amount of frames in this profiling sessionmore…
static proto float GetTimeOfClass(typename clss, bool immediate = false)Obtain [SD] or [PD] regarding the time a specific class consumedmore…
static proto float GetTimeOfFunc(string funct, typename clss, bool immediate = false)Obtain [SD] or [PD] regarding the time consumed by a specific functionmore…
static proto float GetTimeOfFuncG(string funct, bool immediate = false)Obtain [SD] or [PD] regarding the time consumed by a specific global functionmore…
static proto void GetTimePerClass(notnull out array<ref EnProfilerTimeClassPair> outArr, int count = int.MAX)Obtain [SD] for Time Per Classmore…
static proto void GetTimePerFunc(notnull out array<ref EnProfilerTimeFuncPair> outArr, int count = int.MAX)Obtain [SD] for Time Per Functionmore…
static proto int GetTimeResolution()Get the currently set time resolutionmore…
static proto int GetTotalFrames()Get the total amount of frames across all profiling sessionmore…
static proto bool IsAverage()Check if returning of average data is enabledmore…
static proto int IsEnabled()Return if script profiling is enabledmore…
static bool IsEnabledC()Return if script profiling is actually turned on inside of the script contextmore…
static bool IsEnabledD()Return if script profiling is enabled through [DM]more…
static bool IsEnabledP()Return if script profiling is enabled through EnProfilermore…
static proto bool IsFlagsSet(int flags)Check if the flags are setmore…
static proto owned string ModuleToName(EnProfilerModule module)Helper to convert EnProfilerModule to stringmore…
static proto bool NameToModule(string moduleName, out EnProfilerModule module)Convert string to EnProfilerModulemore…
static proto int RemoveFlags(int flags, bool sessionReset = true)Remove flags from the currently used set of EnProfilerFlags across the APImore…
static bool RequestImmediateData()Helper method to ascertain the profiler will record [PD] right after this callmore…
static proto void ResetSession(bool fullReset = false)Perform [SR], clearing SessionFrame, ProfiledSessionFrames, [SD] and [PD] (except for [CI])more…
static proto int SetFlags(int flags, bool sessionReset = true)Override the currently used set of EnProfilerFlags across the APImore…
static proto void SetInterval(int interval, bool sessionReset = true)Set the interval for the [SD] to updatemore…
static proto void SetModule(EnProfilerModule module, bool sessionReset = true)Set the module to be profiledmore…
static proto void SetTimeResolution(int resolution)Set the resolution of the fetched Time datamore…
static proto void SortData()The internal sorting that happens at the end of the frame (so it is NOT necessary to call this manually) to supply Get...Per... functionsmore…

Function Documentation

AddFlagsEnProfiler

static proto int AddFlags(int flags, bool sessionReset = true)

Add flags to the currently used set of EnProfilerFlags across the API

flags
int The combination of desired EnProfilerFlags to be added to the currently used set
sessionReset
bool When set to false, no [SR] will trigger, regardless of situation

Returns: int The currently used set of EnProfilerFlags after the function call

NoteSimply a helper method to quickly add EnProfilerFlags
// In the case where the current set of EnProfilerFlags is EnProfilerFlags.RESET
EnProfiler.AddFlags(EnProfilerFlags.RECURSIVE);
// The resulting set of flags now will be EnProfilerFlags.RESET | EnProfilerFlags.RECURSIVE
// As the above is pretty much the same as the following
// EnProfiler.SetFlags(EnProfiler.GetFlags() | EnProfilerFlags.RECURSIVE);
// But a much cleaner and faster alternative (bitwise operations in script is ~10x slower than C++)

ClearFlagsEnProfiler

static proto int ClearFlags(bool sessionReset = true)

Remove all flags from the currently used set of EnProfilerFlags across the API

sessionReset
bool When set to false, no [SR] will trigger, regardless of situation

Returns: int The currently used set of EnProfilerFlags after the function call

NoteSimply a helper method to quickly remove all EnProfilerFlags
// In the case where the current set of EnProfilerFlags is EnProfilerFlags.RESET
EnProfiler.ClearFlags();
// The resulting set of flags now will be EnProfilerFlags.NONE
// As the above is pretty much the same as the following
// EnProfiler.SetFlags(EnProfilerFlags.NONE);
// But a much cleaner and implicit alternative

DumpEnProfiler

static proto void Dump()

Print out [SD] to script log

EnProfiler.Dump();

EnableEnProfiler

static proto void Enable(bool enable, bool immediate = false, bool sessionReset = true)

Enable the gathering of script profiling data

enable
bool Whether to enable or disable, if it was previously not enabled, it will cause [SR]
immediate
bool When true will instantly start/stop profiling, otherwise it will apply it at the end of the frame (to have one stable point in time)
sessionReset
bool When set to false, no [SR] will trigger, regardless of situation
NoteDEFAULT: disabled (unless launched with "-profile", then it is default enabled)
NoteThis is separate from the one in [DM], so toggling it in [DM] will not affect this, and toggling it here will not affect [DM]
NoteIt will ignore the call if trying to set the current state, except when "immediate" is used
NoteDisabling does not cause [SR], so all data will stay intact
WarningKeep in mind that when using immediate, it will not be the data of the entire frame, which can skew data if not kept in mind
// Simple enable, will start profiling the next frame
// Will cause [SR] if !IsEnabledP() before this call
EnProfiler.Enable(true);

// Immediate enable, will start profiling immediately
// Will cause [SR] if !IsEnabledP() before this call
EnProfiler.Enable(true, true);

// Immediate disable, will stop profiling immediately
// Disabling will never cause [SR], preserving data
EnProfiler.Enable(false, true);

// Simple disable, will not profile the next frame (but still finish profiling the current one)
// Disabling will never cause [SR], preserving data
EnProfiler.Enable(false);

EnableAverageEnProfiler

static proto void EnableAverage(bool enable)

Enable/disable returning calculated averages

enable
bool Whether to enable or disable
NoteDEFAULT: false
NoteWhen EnProfilerFlags.RESET flag is not present, it will divide by the session frame
NoteWhen an interval is set, it will divide by the interval
NoteDoes not affect any data itself, only the fetching and displaying of it (therefore, no [SR] is ever triggered by this method)
Note[CI] will never be an average, it will always be the current count of the instance (allocations will be the value of how many times an instance is created)
// For example, take the situation where we only reset every 60 frames
EnProfiler.AddFlags(EnProfilerFlags.RESET);
EnProfiler.SetInterval(60);
EnProfiler.EnableAverage(true);

// And a method is called once per frame, gathering the count of that function will be 1
// Or if a method is called twice per frame, gathering the count of that function will be 2
// Or if a method is 3 times every 3 frames, gathering the count of that function will be 1
// ...
// So you get the average amount of times the method is called per frame, out of the sample of 60 frames

GetAllocationsOfClassEnProfiler

static proto int GetAllocationsOfClass(typename clss, bool immediate = false)

Obtain [SD] or [PD] regarding the allocations of a specific class

clss
typename Typename of desired class
immediate
bool When true, it will pull from [SD], when false it will pull from [PD]

Returns: int Allocations of the specified class

int allocationsOfClass = EnProfiler.GetAllocationsOfClass(StaticGetType(EPTHelperClass), true);

GetAllocationsPerClassEnProfiler

static proto void GetAllocationsPerClass(notnull out array<ref EnProfilerCountClassPair> outArr, int count = int.MAX)

Obtain [SD] for Allocations Per Class

outArr
array<ref EnProfilerCountClassPair> Array sorted by number of allocations of a class
count
int The maximum amount of entries wanted
array<ref EnProfilerCountClassPair> allocPerClass = {};
EnProfiler.GetAllocationsPerClass(allocPerClass, 20);

GetCountOfFuncEnProfiler

static proto int GetCountOfFunc(string funct, typename clss, bool immediate = false)

Obtain [SD] or [PD] regarding the amount of times a specific function was called

funct
string Function name
clss
typename Typename of class the function belongs to
immediate
bool When true, it will pull from [SD], when false it will pull from [PD]

Returns: int Amount of calls to the specified function or -1 when function was not found

int callCountOfFunc = EnProfiler.GetCountOfFunc("StringFormat", StaticGetType(EnProfilerTests), true);

GetCountOfFuncGEnProfiler

static proto int GetCountOfFuncG(string funct, bool immediate = false)

Obtain [SD] or [PD] regarding the amount of times a specific function was called

funct
string Function name
immediate
bool When true, it will pull from [SD], when false it will pull from [PD]

Returns: int Amount of calls to the specified function or -1 when function was not found

int callCountOfFunc = EnProfiler.GetCountOfFuncG("ErrorEx", true);

GetCountPerFuncEnProfiler

static proto void GetCountPerFunc(notnull out array<ref EnProfilerCountFuncPair> outArr, int count = int.MAX)

Obtain [SD] for Count Per Function

outArr
array<ref EnProfilerCountFuncPair> Array sorted by amount of times a function was called
count
int The maximum amount of entries wanted
array<ref EnProfilerCountFuncPair> countPerFunc = {};
EnProfiler.GetCountPerFunc(countPerFunc, 20);

GetFlagsEnProfiler

static proto int GetFlags()

Get the currently used flags across the API

Returns: int The currently used set of EnProfilerFlags

int flags = EnProfiler.GetFlags();

if (flags & EnProfilerFlags.RECURSIVE)
{
	Print("Currently profiling all modules.");
}

GetGameFrameEnProfiler

static proto int GetGameFrame()

Get the total amount of frames passed

Returns: int The total amount of frames passed

int gameFrame = EnProfiler.GetGameFrame();

GetInstancesOfClassEnProfiler

static proto int GetInstancesOfClass(typename clss, bool immediate = false)

Obtain [SD] or [PD] regarding the [CI] of a specific class

clss
typename Typename of desired class
immediate
bool When true, it will pull from [SD], when false it will pull from [PD]

Returns: int [CI] of the specified class

int instancesOfClass = EnProfiler.GetInstancesOfClass(StaticGetType(EPTHelperClass), true);

GetInstancesPerClassEnProfiler

static proto void GetInstancesPerClass(notnull out array<ref EnProfilerCountClassPair> outArr, int count = int.MAX)

Obtain [SD] for Instances Per Class

outArr
array<ref EnProfilerCountClassPair> Array sorted by number of instances of a class
count
int The maximum amount of entries wanted
array<ref EnProfilerCountClassPair> instancesPerClass = {};
EnProfiler.GetInstancesPerClass(instancesPerClass, 20);

GetIntervalEnProfiler

static proto int GetInterval()

Get the currently set interval

Returns: int The currently set interval

int currentInterval = EnProfiler.GetInterval();

GetModuleEnProfiler

static proto EnProfilerModule GetModule()

Get the currently profiled module

Returns: EnProfilerModule The currently profiled module

EnProfilerModule module = EnProfiler.GetModule();

GetProfiledFramesEnProfiler

static proto int GetProfiledFrames()

Get the total amount of frames profiled across all profiling session

Returns: int The total amount of frames profiled across all profiling session

NoteThis will only differ from GetTotalFrames when there was an Interval set at some point
int totalProfiledFrames = EnProfiler.GetProfiledFrames();

GetProfiledSessionFramesEnProfiler

static proto int GetProfiledSessionFrames()

Get the total amount of frames profiled in this profiling session

Returns: int The total amount of frames profiled in this profiling session

NoteThis will only differ from GetSessionFrame when there is an Interval set
int profiledSessionFrames = EnProfiler.GetProfiledSessionFrames();

GetSessionFrameEnProfiler

static proto int GetSessionFrame()

Get the total amount of frames in this profiling session

Returns: int The total amount of frames in this profiling session

NoteThis will only differ from GetProfiledSessionFrames when there is an Interval set
int sessionFrame = EnProfiler.GetSessionFrame();

GetTimeOfClassEnProfiler

static proto float GetTimeOfClass(typename clss, bool immediate = false)

Obtain [SD] or [PD] regarding the time a specific class consumed

clss
typename Typename of desired class
immediate
bool When true, it will pull from [SD], when false it will pull from [PD]

Returns: float Time consumed by the specified class

// Consider the class
EPTHelperClass clss = new EPTHelperClass();

// Some functions being called here...

// Gathering of data can be done through
float timeOfClass = EnProfiler.GetTimeOfClass(clss.Type(), true);

// Or when you have no variable/reference
float timeOfClass2 = EnProfiler.GetTimeOfClass(StaticGetType(EPTHelperClass), true);

GetTimeOfFuncEnProfiler

static proto float GetTimeOfFunc(string funct, typename clss, bool immediate = false)

Obtain [SD] or [PD] regarding the time consumed by a specific function

funct
string Function name
clss
typename Typename of class the function belongs to
immediate
bool When true, it will pull from [SD], when false it will pull from [PD]

Returns: float Time consumed by the specified function or -1 when function was not found

float timeOfFunc = EnProfiler.GetTimeOfFunc("StringFormat", StaticGetType(EnProfilerTests), true);

GetTimeOfFuncGEnProfiler

static proto float GetTimeOfFuncG(string funct, bool immediate = false)

Obtain [SD] or [PD] regarding the time consumed by a specific global function

funct
string Function name
immediate
bool When true, it will pull from [SD], when false it will pull from [PD]

Returns: float Time consumed by the specified function or -1 when function was not found

float timeOfFunc = EnProfiler.GetTimeOfFuncG("ErrorEx", true);

GetTimePerClassEnProfiler

static proto void GetTimePerClass(notnull out array<ref EnProfilerTimeClassPair> outArr, int count = int.MAX)

Obtain [SD] for Time Per Class

outArr
array<ref EnProfilerTimeClassPair> Array sorted by time consumed by a class
count
int The maximum amount of entries wanted
// In this example the array will be filled with the 20 most time intensive classes
// If there are less than 20 classes which consumed time, it will output that number of classes instead
array<ref EnProfilerTimeClassPair> timePerClass = {};
EnProfiler.GetTimePerClass(timePerClass, 20);

// In this example the array will be filled with all classes sorted by time
array<ref EnProfilerTimeClassPair> timePerClass2 = {};
EnProfiler.GetTimePerClass(timePerClass2);

GetTimePerFuncEnProfiler

static proto void GetTimePerFunc(notnull out array<ref EnProfilerTimeFuncPair> outArr, int count = int.MAX)

Obtain [SD] for Time Per Function

outArr
array<ref EnProfilerTimeFuncPair> Array sorted by time consumed by a function
count
int The maximum amount of entries wanted
array<ref EnProfilerTimeFuncPair> timePerFunc = {};
EnProfiler.GetTimePerFunc(timePerFunc, 20);

GetTimeResolutionEnProfiler

static proto int GetTimeResolution()

Get the currently set time resolution

Returns: int The currently set resolution

int currentTimeResolution = EnProfiler.GetTimeResolution();

GetTotalFramesEnProfiler

static proto int GetTotalFrames()

Get the total amount of frames across all profiling session

Returns: int The total amount of frames across all profiling session

NoteThis will only differ from GetProfiledFrames when there was an Interval set at some point
int totalFrames = EnProfiler.GetTotalFrames();

IsAverageEnProfiler

static proto bool IsAverage()

Check if returning of average data is enabled

Returns: bool Whether returning of average data is enabled

bool isDataAverage = EnProfiler.IsAverage();

IsEnabledEnProfiler

static proto int IsEnabled()

Return if script profiling is enabled

Returns: int Flags regarding the current state

NoteHelper methods below
int isScriptProfilingEnabled = EnProfiler.IsEnabled();

IsEnabledCEnProfiler

static bool IsEnabledC()

Return if script profiling is actually turned on inside of the script context

Returns: bool Whether script is being profiled as of this moment

NoteWhen using "-profile" launch parameter, it will enable it through EnProfiler, so this will return true
bool isScriptProfilingEnabled = EnProfiler.IsEnabledC();
References IsEnabled()

IsEnabledDEnProfiler

static bool IsEnabledD()

Return if script profiling is enabled through [DM]

Returns: bool Whether script profiling is enabled through [DM]

bool isScriptProfilingDiagEnabled = EnProfiler.IsEnabledD();
References IsEnabled()

IsEnabledPEnProfiler

static bool IsEnabledP()

Return if script profiling is enabled through EnProfiler

Returns: bool Whether script profiling is enabled through script profiler

NoteWhen using "-profile" launch parameter, it will enable it through EnProfiler, so this will return true
bool isScriptProfilingToggleEnabled = EnProfiler.IsEnabledP();
References IsEnabled()

IsFlagsSetEnProfiler

static proto bool IsFlagsSet(int flags)

Check if the flags are set

flags
int The combination of EnProfilerFlags to check if present

Returns: bool If the flags are set

NoteIs effectively the same as the code displayed in GetFlags example, but without the bitwise operation
if (EnProfiler.IsFlagsSet(EnProfilerFlags.ALL))
{
	Print("Currently all flags are enabled.");
}

if (EnProfiler.IsFlagsSet(EnProfilerFlags.RECURSIVE))
{
	Print("Currently profiling all modules.");
}

ModuleToNameEnProfiler

static proto owned string ModuleToName(EnProfilerModule module)

Helper to convert EnProfilerModule to string

module
EnProfilerModule The module to get the name of

Returns: string The name of the module

string moduleName = EnProfiler.ModuleToName(EnProfilerModule.GAME);

NameToModuleEnProfiler

static proto bool NameToModule(string moduleName, out EnProfilerModule module)

Convert string to EnProfilerModule

moduleName
string The name of the module
module
EnProfilerModule The enum value of the module or EnProfilerModule.ERROR if not found

Returns: bool Whether the module was found

// Get the name of the module of the current class
string nameOfCurrentModule = Type().GetModule();
EnProfilerModule module;

// Convert it to the enum value
if (EnProfiler.NameToModule(nameOfCurrentModule, module))
{
	EnProfiler.SetModule(module);
}
else
{
	ErrorEx(string.Format("Could not find EnProfilerModule: %1", nameOfCurrentModule));
}

RemoveFlagsEnProfiler

static proto int RemoveFlags(int flags, bool sessionReset = true)

Remove flags from the currently used set of EnProfilerFlags across the API

flags
int The combination of desired EnProfilerFlags to be added to the currently used set
sessionReset
bool When set to false, no [SR] will trigger, regardless of situation

Returns: int The currently used set of EnProfilerFlags after the function call

NoteSimply a helper method to quickly remove EnProfilerFlags
// In the case where the current set of EnProfilerFlags is EnProfilerFlags.RESET
EnProfiler.RemoveFlags(EnProfilerFlags.RESET);
// The resulting set of flags now will be EnProfilerFlags.NONE
// As the above is pretty much the same as the following
// EnProfiler.SetFlags(EnProfiler.GetFlags() & ~EnProfilerFlags.RECURSIVE);
// But a much cleaner and faster alternative (bitwise operations in script is ~10x slower than C++)

RequestImmediateDataEnProfiler

static bool RequestImmediateData()

Helper method to ascertain the profiler will record [PD] right after this call

Returns: bool Whether it was enabled before or not

bool wasEnabled = EnProfiler.RequestImmediateData();
References Enable(), and IsEnabledC()

ResetSessionEnProfiler

static proto void ResetSession(bool fullReset = false)

Perform [SR], clearing SessionFrame, ProfiledSessionFrames, [SD] and [PD] (except for [CI])

fullReset
bool Whether to clear [PD] of all modules, when false it will only clear the [PD] according to current settings
NoteCan also be triggered by a variety of other functions in this API
NoteWhen triggered by the other functions, it will call with fullReset = false
// Considering the settings: SetFlags(EnProfilerFlags.NONE) and SetModule(EnProfilerModule.GAME)
// The following call will only clear [PD] of 3_Game
EnProfiler.ResetSession();

// Considering the settings: SetFlags(EnProfilerFlags.RECURSIVE) and SetModule(EnProfilerModule.WORLD)
// The following call will clear [PD] of 3_Game, 4_World, 5_Mission and their children
EnProfiler.ResetSession();

// The following call resets [PD] across all modules
EnProfiler.ResetSession(true);

SetFlagsEnProfiler

static proto int SetFlags(int flags, bool sessionReset = true)

Override the currently used set of EnProfilerFlags across the API

flags
int The combination of desired EnProfilerFlags to override the currently used set
sessionReset
bool When set to false, no [SR] will trigger, regardless of situation

Returns: int The currently used set of EnProfilerFlags after the function call

NoteDEFAULT: EnProfilerFlags.ALL
// No RESET flag, [PD] will be accumulated across frames
// No RECURSIVE flag, only the curently profiled module will be sorted
EnProfiler.SetFlags(EnProfilerFlags.NONE);

// RESET flag, [PD] will be reset after sorting
// No RECURSIVE flag, only the curently profiled module will be sorted
EnProfiler.SetFlags(EnProfilerFlags.RESET);

// RESET flag, [PD] will be reset after sorting
// RECURSIVE flag, all modules will be sorted
EnProfiler.SetFlags(EnProfilerFlags.ALL);

SetIntervalEnProfiler

static proto void SetInterval(int interval, bool sessionReset = true)

Set the interval for the [SD] to update

interval
int Amount of frames to wait before [SD] is updated
sessionReset
bool When set to false, no [SR] will trigger, regardless of situation
NoteDEFAULT: 0
Note[DM] has the following values: {0, 5, 10, 20, 30, 50, 60, 120, 144}; When an interval not part of this list is set, [DM] will be set to "CUSTOM_INTERVAL"
NoteDoes not affect the gathering of [PD], this will happen continuously as the profiling is enabled
NoteThis also delays the [SR] caused by EnProfilerFlags.RESET
// This will make it so that [SD] is updated every 60 frames
EnProfiler.SetInterval(60);

SetModuleEnProfiler

static proto void SetModule(EnProfilerModule module, bool sessionReset = true)

Set the module to be profiled

module
EnProfilerModule The module to profile
sessionReset
bool When set to false, no [SR] will trigger, regardless of situation
NoteDEFAULT: EnProfilerModule.CORE
NoteWhen session reset is enabled, it will only reset the module which it is currently being set to, previous module data will be untouched
EnProfiler.SetModule(EnProfilerModule.WORLD);

SetTimeResolutionEnProfiler

static proto void SetTimeResolution(int resolution)

Set the resolution of the fetched Time data

resolution
int The nth resolution of a second
NoteDEFAULT: 100000
Note[DM] has the following values: {100000, 1000000, 1, 10, 100, 1000, 10000}; These are the only values available, otherwise it will round up to one in the list
NoteDoes not affect any data itself, only the fetching and displaying of it (therefore, no [SR] is ever triggered by this method)
// Have all time being reported in 1 second
EnProfiler.SetTimeResolution(1);

// Have all time being reported in 1000th of a second (ms)
EnProfiler.SetTimeResolution(1000);

SortDataEnProfiler

static proto void SortData()

The internal sorting that happens at the end of the frame (so it is NOT necessary to call this manually) to supply Get...Per... functions

NoteThis will clear the previous [SD] and sort the [PD] currently available at this moment
NoteFlags apply to this
WarningKeep in mind that EnProfilerFlags.RESET will clear all [PD] after this is called
// Sorting all the currently available [PD], populating [SD]
EnProfiler.SortData();

// If flag EnProfilerFlags.RESET is enabled, then this will return 0 now even if it has been called, as [PD] has been cleared
// This goes for any Get...Of... function (Except for [CI], the counter persists)
EnProfiler.GetTimeOfFunc("Sleep", EnProfilerTests, true);