plugins/include/profiler.inc
author Nicholas Hastings <skamonkey@gmail.com>
Wed Jul 06 22:34:21 2011 -0400 (2011-07-06)
changeset 3340 7eb2b72e42d8
parent 2289 44045ead61cd
permissions -rw-r--r--
Added native interface for Basecomm plugin (bug 2594, r=fyren).
dvander@914
     1
/**
dvander@914
     2
 * vim: set ts=4 :
ds@1330
     3
 * =============================================================================
ds@1947
     4
 * SourceMod (C)2004-2008 AlliedModders LLC.  All rights reserved.
ds@1330
     5
 * =============================================================================
ds@1330
     6
 *
ds@1330
     7
 * This file is part of the SourceMod/SourcePawn SDK.
dvander@914
     8
 *
ds@1330
     9
 * This program is free software; you can redistribute it and/or modify it under
ds@1330
    10
 * the terms of the GNU General Public License, version 3.0, as published by the
ds@1330
    11
 * Free Software Foundation.
ds@1330
    12
 * 
ds@1330
    13
 * This program is distributed in the hope that it will be useful, but WITHOUT
ds@1330
    14
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
ds@1330
    15
 * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
ds@1330
    16
 * details.
ds@1330
    17
 *
ds@1330
    18
 * You should have received a copy of the GNU General Public License along with
ds@1330
    19
 * this program.  If not, see <http://www.gnu.org/licenses/>.
ds@1330
    20
 *
ds@1330
    21
 * As a special exception, AlliedModders LLC gives you permission to link the
ds@1330
    22
 * code of this program (as well as its derivative works) to "Half-Life 2," the
ds@1330
    23
 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
ds@1330
    24
 * by the Valve Corporation.  You must obey the GNU General Public License in
ds@1330
    25
 * all respects for all other code used.  Additionally, AlliedModders LLC grants
ds@1330
    26
 * this exception to all derivative works.  AlliedModders LLC defines further
ds@1330
    27
 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
ds@1330
    28
 * or <http://www.sourcemod.net/license.php>.
dvander@914
    29
 *
dvander@914
    30
 * Version: $Id$
dvander@914
    31
 */
dvander@914
    32
dvander@914
    33
#if defined _profiler_included
dvander@914
    34
 #endinput
dvander@914
    35
#endif
dvander@914
    36
#define _profiler_included
dvander@914
    37
dvander@914
    38
/**
dvander@914
    39
 * ONLY AVAILABLE ON WINDOWS RIGHT NOW K.
dvander@914
    40
 */
dvander@914
    41
 
dvander@914
    42
/**
dvander@914
    43
 * Creates a new profile object.  The Handle must be freed
dvander@914
    44
 * using CloseHandle().
dvander@914
    45
 *
dvander@914
    46
 * @return			Handle to the profiler object.
dvander@914
    47
 */
dvander@914
    48
native Handle:CreateProfiler();
dvander@914
    49
dvander@914
    50
/**
dvander@914
    51
 * Starts profiling.
dvander@914
    52
 *
dvander@914
    53
 * @param prof		Profiling object.
dvander@914
    54
 * @noreturn
dvander@914
    55
 * @error			Invalid Handle.
dvander@914
    56
 */
dvander@914
    57
native StartProfiling(Handle:prof);
dvander@914
    58
dvander@914
    59
/**
dvander@914
    60
 * Stops profiling.
dvander@914
    61
 *
dvander@914
    62
 * @param prof		Profiling object.
dvander@914
    63
 * @noreturn
dvander@914
    64
 * @error			Invalid Handle or profiling was never started.
dvander@914
    65
 */
dvander@914
    66
native StopProfiling(Handle:prof);
dvander@914
    67
dvander@914
    68
/**
dvander@914
    69
 * Returns the amount of high-precision time in seconds
dvander@914
    70
 * that passed during the profiler's last start/stop 
dvander@914
    71
 * cycle.
dvander@914
    72
 *
dvander@914
    73
 * @param prof		Profiling object.
dvander@914
    74
 * @return			Time elapsed in seconds.
dvander@914
    75
 * @error			Invalid Handle.
dvander@914
    76
 */
dvander@914
    77
native Float:GetProfilerTime(Handle:prof);