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