Add Profiler methodmap (#814)
* Add profiler methodmap * No tag mismatches here thanks pm * Lets fix some documentation while we're here. * Use proper methodmap documentation style Across sm we use `//` for methodmap docs, so lets just keep this consistent
This commit is contained in:
parent
85a1d3e78a
commit
c09b32010f
@ -223,6 +223,11 @@ REGISTER_NATIVES(profilerNatives)
|
||||
{"EnterProfilingEvent", EnterProfilingEvent},
|
||||
{"LeaveProfilingEvent", LeaveProfilingEvent},
|
||||
{"IsProfilingActive", IsProfilingActive},
|
||||
|
||||
{"Profiler.Profiler", CreateProfiler},
|
||||
{"Profiler.Time.get", GetProfilerTime},
|
||||
{"Profiler.Start", StartProfiling},
|
||||
{"Profiler.Stop", StopProfiling},
|
||||
{NULL, NULL},
|
||||
};
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* vim: set ts=4 :
|
||||
* =============================================================================
|
||||
* SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
|
||||
* SourceMod (C)2004-2018 AlliedModders LLC. All rights reserved.
|
||||
* =============================================================================
|
||||
*
|
||||
* This file is part of the SourceMod/SourcePawn SDK.
|
||||
@ -38,14 +38,40 @@
|
||||
/**
|
||||
* ONLY AVAILABLE ON WINDOWS RIGHT NOW K.
|
||||
*/
|
||||
|
||||
|
||||
methodmap Profiler < Handle
|
||||
{
|
||||
// Creates a new profile object. The Handle must be freed
|
||||
// using delete or CloseHandle().
|
||||
//
|
||||
// @return A new Profiler Handle.
|
||||
public native Profiler();
|
||||
|
||||
// Starts a cycle for profiling.
|
||||
public native void Start();
|
||||
|
||||
// Stops a cycle for profiling.
|
||||
//
|
||||
// @error Profiler was never started.
|
||||
public native void Stop();
|
||||
|
||||
// Returns the amount of high-precision time in seconds
|
||||
// that passed during the profiler's last start/stop
|
||||
// cycle.
|
||||
//
|
||||
// @return Time elapsed in seconds.
|
||||
property float Time {
|
||||
public native get();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new profile object. The Handle must be freed
|
||||
* using CloseHandle().
|
||||
* using delete or CloseHandle().
|
||||
*
|
||||
* @return Handle to the profiler object.
|
||||
*/
|
||||
native Handle CreateProfiler();
|
||||
native Profiler CreateProfiler();
|
||||
|
||||
/**
|
||||
* Starts profiling.
|
||||
|
Loading…
Reference in New Issue
Block a user