#include "quakedef.h"
#include "progsvm.h"
-char *prvm_opnames[] =
+const char *prvm_opnames[] =
{
"^5DONE",
char *PRVM_GlobalString (int ofs);
char *PRVM_GlobalStringNoContents (int ofs);
+extern ddef_t *PRVM_ED_FieldAtOfs(int ofs);
//=============================================================================
=================
*/
extern cvar_t prvm_statementprofiling;
+extern cvar_t prvm_timeprofiling;
void PRVM_PrintStatement (dstatement_t *s)
{
size_t i;
Con_Printf( "%s:%i: ", PRVM_GetString( prog->xfunction->s_file ), prog->statement_linenums[ opnum ] );
if (prvm_statementprofiling.integer)
- Con_Printf("%7i ", prog->statement_profile[s - prog->statements]);
+ Con_Printf("%7.0f ", prog->statement_profile[s - prog->statements]);
if ( (unsigned)s->op < sizeof(prvm_opnames)/sizeof(prvm_opnames[0]))
{
endstatement = prog->functions[i].first_statement;
// now print the range of statements
- Con_Printf("%s progs: disassembly of function %s (statements %i-%i):\n", PRVM_NAME, name, firststatement, endstatement);
+ Con_Printf("%s progs: disassembly of function %s (statements %i-%i, locals %i-%i):\n", PRVM_NAME, name, firststatement, endstatement, func->parm_start, func->parm_start + func->locals - 1);
for (i = firststatement;i < endstatement;i++)
{
PRVM_PrintStatement(prog->statements + i);
}
}
-
-/*
-============
-PRVM_Profile_f
-
-============
-*/
-void PRVM_Profile_f (void)
+void PRVM_ShortStackTrace(char *buf, size_t bufsize)
{
- mfunction_t *f, *best;
- int i, num, max/*, howmany*/;
+ mfunction_t *f;
+ int i;
- //howmany = 10;
- //if (Cmd_Argc() == 2)
- // howmany = atoi(Cmd_Argv(1));
- if(Cmd_Argc() != 2)
+ if(prog)
{
- Con_Print("prvm_profile <program name>\n");
+ dpsnprintf(buf, bufsize, "(%s) ", prog->name);
+ }
+ else
+ {
+ strlcpy(buf, "<NO PROG>", bufsize);
return;
}
- PRVM_Begin;
- if(!PRVM_SetProgFromString(Cmd_Argv(1)))
- return;
+ prog->stack[prog->depth].s = prog->xstatement;
+ prog->stack[prog->depth].f = prog->xfunction;
+ for (i = prog->depth;i > 0;i--)
+ {
+ f = prog->stack[i].f;
- Con_Printf( "%s Profile:\n[CallCount] [Statements] [BuiltinCost]\n", PRVM_NAME );
+ if(strlcat(buf,
+ f
+ ? va("%s:%s(%i) ", PRVM_GetString(f->s_file), PRVM_GetString(f->s_name), prog->stack[i].s - f->first_statement)
+ : "<NULL> ",
+ bufsize
+ ) >= bufsize)
+ break;
+ }
+}
- num = 0;
+
+void PRVM_CallProfile (void)
+{
+ mfunction_t *f, *best;
+ int i;
+ double max;
+ double sum;
+
+ Con_Printf( "%s Call Profile:\n", PRVM_NAME );
+
+ sum = 0;
do
{
max = 0;
for (i=0 ; i<prog->progs->numfunctions ; i++)
{
f = &prog->functions[i];
- if (max < f->profile + f->builtinsprofile + f->callcount)
+ if (max < f->totaltime)
{
- max = f->profile + f->builtinsprofile + f->callcount;
+ max = f->totaltime;
best = f;
}
}
if (best)
{
- //if (num < howmany)
- if (best->first_statement < 0)
- Con_Printf("%10i ----- builtin ----- %s\n", best->callcount, PRVM_GetString(best->s_name));
+ sum += best->totaltime;
+ Con_Printf("%9.4f %s\n", best->totaltime, PRVM_GetString(best->s_name));
+ best->totaltime = 0;
+ }
+ } while (best);
+
+ Con_Printf("Total time since last profile reset: %9.4f\n", Sys_DoubleTime() - prog->starttime);
+ Con_Printf(" - used by QC code of this VM: %9.4f\n", sum);
+
+ prog->starttime = Sys_DoubleTime();
+}
+
+void PRVM_Profile (int maxfunctions, double mintime, int sortby)
+{
+ mfunction_t *f, *best;
+ int i, num;
+ double max;
+
+ if(!prvm_timeprofiling.integer)
+ mintime *= 10000000; // count each statement as about 0.1µs
+
+ if(prvm_timeprofiling.integer)
+ Con_Printf( "%s Profile:\n[CallCount] [Time] [BuiltinTm] [Statement] [BuiltinCt] [TimeTotal] [StmtTotal] [BltnTotal] [self]\n", PRVM_NAME );
+ // 12345678901 12345678901 12345678901 12345678901 12345678901 12345678901 12345678901 123.45%
+ else
+ Con_Printf( "%s Profile:\n[CallCount] [Statement] [BuiltinCt] [StmtTotal] [BltnTotal] [self]\n", PRVM_NAME );
+ // 12345678901 12345678901 12345678901 12345678901 12345678901 123.45%
+
+ num = 0;
+ do
+ {
+ max = 0;
+ best = NULL;
+ for (i=0 ; i<prog->progs->numfunctions ; i++)
+ {
+ f = &prog->functions[i];
+ if(prvm_timeprofiling.integer)
+ {
+ if(sortby)
+ {
+ if(f->first_statement < 0)
+ {
+ if (max < f->tprofile)
+ {
+ max = f->tprofile;
+ best = f;
+ }
+ }
+ else
+ {
+ if (max < f->tprofile_total)
+ {
+ max = f->tprofile_total;
+ best = f;
+ }
+ }
+ }
+ else
+ {
+ if (max < f->tprofile + f->tbprofile)
+ {
+ max = f->tprofile + f->tbprofile;
+ best = f;
+ }
+ }
+ }
else
- Con_Printf("%10i%10i%10i %s\n", best->callcount, best->profile, best->builtinsprofile, PRVM_GetString(best->s_name));
+ {
+ if(sortby)
+ {
+ if (max < f->profile_total + f->builtinsprofile_total + f->callcount)
+ {
+ max = f->profile_total + f->builtinsprofile_total + f->callcount;
+ best = f;
+ }
+ }
+ else
+ {
+ if (max < f->profile + f->builtinsprofile + f->callcount)
+ {
+ max = f->profile + f->builtinsprofile + f->callcount;
+ best = f;
+ }
+ }
+ }
+ }
+ if (best)
+ {
+ if (num < maxfunctions && max > mintime)
+ {
+ if(prvm_timeprofiling.integer)
+ {
+ if (best->first_statement < 0)
+ Con_Printf("%11.0f %11.6f ------------- builtin ------------- %11.6f ----------- builtin ----------- %s\n", best->callcount, best->tprofile, best->tprofile, PRVM_GetString(best->s_name));
+ // %11.6f 12345678901 12345678901 12345678901 %11.6f 12345678901 12345678901 123.45%
+ else
+ Con_Printf("%11.0f %11.6f %11.6f %11.0f %11.0f %11.6f %11.0f %11.0f %6.2f%% %s\n", best->callcount, best->tprofile, best->tbprofile, best->profile, best->builtinsprofile, best->tprofile_total, best->profile_total, best->builtinsprofile_total, (best->tprofile_total > 0) ? ((best->tprofile) * 100.0 / (best->tprofile_total)) : -99.99, PRVM_GetString(best->s_name));
+ }
+ else
+ {
+ if (best->first_statement < 0)
+ Con_Printf("%11.0f ----------------------- builtin ----------------------- %s\n", best->callcount, PRVM_GetString(best->s_name));
+ // 12345678901 12345678901 12345678901 12345678901 123.45%
+ else
+ Con_Printf("%11.0f %11.0f %11.0f %11.0f %11.0f %6.2f%% %s\n", best->callcount, best->profile, best->builtinsprofile, best->profile_total, best->builtinsprofile_total, (best->profile + best->builtinsprofile) * 100.0 / (best->profile_total + best->builtinsprofile_total), PRVM_GetString(best->s_name));
+ }
+ }
num++;
best->profile = 0;
+ best->tprofile = 0;
+ best->tbprofile = 0;
best->builtinsprofile = 0;
+ best->profile_total = 0;
+ best->tprofile_total = 0;
+ best->builtinsprofile_total = 0;
best->callcount = 0;
}
} while (best);
+}
+
+/*
+============
+PRVM_CallProfile_f
+
+============
+*/
+void PRVM_CallProfile_f (void)
+{
+ if (Cmd_Argc() != 2)
+ {
+ Con_Print("prvm_callprofile <program name>\n");
+ return;
+ }
+
+ PRVM_Begin;
+ if(!PRVM_SetProgFromString(Cmd_Argv(1)))
+ return;
+
+ PRVM_CallProfile();
PRVM_End;
}
-void PRVM_CrashAll()
+/*
+============
+PRVM_Profile_f
+
+============
+*/
+void PRVM_Profile_f (void)
+{
+ int howmany;
+
+ howmany = 1<<30;
+ if (Cmd_Argc() == 3)
+ howmany = atoi(Cmd_Argv(2));
+ else if (Cmd_Argc() != 2)
+ {
+ Con_Print("prvm_profile <program name>\n");
+ return;
+ }
+
+ PRVM_Begin;
+ if(!PRVM_SetProgFromString(Cmd_Argv(1)))
+ return;
+
+ PRVM_Profile(howmany, 0, 0);
+
+ PRVM_End;
+}
+
+void PRVM_ChildProfile_f (void)
+{
+ int howmany;
+
+ howmany = 1<<30;
+ if (Cmd_Argc() == 3)
+ howmany = atoi(Cmd_Argv(2));
+ else if (Cmd_Argc() != 2)
+ {
+ Con_Print("prvm_childprofile <program name>\n");
+ return;
+ }
+
+ PRVM_Begin;
+ if(!PRVM_SetProgFromString(Cmd_Argv(1)))
+ return;
+
+ PRVM_Profile(howmany, 0, 1);
+
+ PRVM_End;
+}
+
+void PRVM_CrashAll(void)
{
int i;
prvm_prog_t *oldprog = prog;
void PRVM_PrintState(void)
{
int i;
+ if(prog->statestring)
+ {
+ Con_Printf("Caller-provided information: %s\n", prog->statestring);
+ }
if (prog->xfunction)
{
for (i = -7; i <= 0;i++)
PRVM_StackTrace ();
}
-void PRVM_Crash()
+extern sizebuf_t vm_tempstringsbuf;
+extern cvar_t prvm_errordump;
+void Host_Savegame_to (const char *name);
+void PRVM_Crash(void)
{
if (prog == NULL)
return;
+ prog->funcoffsets.SV_Shutdown = 0; // don't call SV_Shutdown on crash
+
if( prog->depth > 0 )
{
Con_Printf("QuakeC crash report for %s:\n", PRVM_NAME);
PRVM_PrintState();
}
+ if(prvm_errordump.integer)
+ {
+ // make a savegame
+ Host_Savegame_to(va("crash-%s.dmp", PRVM_NAME));
+ }
+
// dump the stack so host_error can shutdown functions
prog->depth = 0;
prog->localstack_used = 0;
+ // delete all tempstrings (FIXME: is this safe in VM->engine->VM recursion?)
+ vm_tempstringsbuf.cursize = 0;
+
// reset the prog pointer
prog = NULL;
}
prog->stack[prog->depth].s = prog->xstatement;
prog->stack[prog->depth].f = prog->xfunction;
+ prog->stack[prog->depth].profile_acc = -f->profile;
+ prog->stack[prog->depth].tprofile_acc = -f->tprofile + -f->tbprofile;
+ prog->stack[prog->depth].builtinsprofile_acc = -f->builtinsprofile;
prog->depth++;
if (prog->depth >=PRVM_MAX_STACK_DEPTH)
PRVM_ERROR ("stack overflow");
}
}
+ ++f->recursion;
prog->xfunction = f;
return f->first_statement - 1; // offset the s++
}
int PRVM_LeaveFunction (void)
{
int i, c;
+ mfunction_t *f;
if (prog->depth <= 0)
PRVM_ERROR ("prog stack underflow in %s", PRVM_NAME);
// up stack
prog->depth--;
+ f = prog->xfunction;
+ --f->recursion;
prog->xfunction = prog->stack[prog->depth].f;
+ prog->stack[prog->depth].profile_acc += f->profile;
+ prog->stack[prog->depth].tprofile_acc += f->tprofile + f->tbprofile;
+ prog->stack[prog->depth].builtinsprofile_acc += f->builtinsprofile;
+ if(prog->depth > 0)
+ {
+ prog->stack[prog->depth-1].profile_acc += prog->stack[prog->depth].profile_acc;
+ prog->stack[prog->depth-1].tprofile_acc += prog->stack[prog->depth].tprofile_acc;
+ prog->stack[prog->depth-1].builtinsprofile_acc += prog->stack[prog->depth].builtinsprofile_acc;
+ }
+ if(!f->recursion)
+ {
+ // if f is already on the call stack...
+ // we cannot add this profile data to it now
+ // or we would add it more than once
+ // so, let's only add to the function's profile if it is the outermost call
+ f->profile_total += prog->stack[prog->depth].profile_acc;
+ f->tprofile_total += prog->stack[prog->depth].tprofile_acc;
+ f->builtinsprofile_total += prog->stack[prog->depth].builtinsprofile_acc;
+ }
+
return prog->stack[prog->depth].s;
}
// nothing here yet
}
-/*
-====================
-PRVM_ExecuteProgram
-====================
-*/
-// LordHavoc: optimized
#define OPA ((prvm_eval_t *)&prog->globals.generic[(unsigned short) st->a])
#define OPB ((prvm_eval_t *)&prog->globals.generic[(unsigned short) st->b])
#define OPC ((prvm_eval_t *)&prog->globals.generic[(unsigned short) st->c])
-extern cvar_t prvm_boundscheck;
extern cvar_t prvm_traceqc;
extern cvar_t prvm_statementprofiling;
-extern int PRVM_ED_FindFieldOffset (const char *field);
-extern ddef_t* PRVM_ED_FindGlobal(const char *name);
-void PRVM_ExecuteProgram (func_t fnum, const char *errormessage)
+extern sizebuf_t vm_tempstringsbuf;
+extern qboolean prvm_runawaycheck;
+
+#ifdef PROFILING
+/*
+====================
+MVM_ExecuteProgram
+====================
+*/
+void MVM_ExecuteProgram (func_t fnum, const char *errormessage)
{
dstatement_t *st, *startst;
mfunction_t *f, *newf;
prvm_edict_t *ed;
prvm_eval_t *ptr;
int jumpcount, cachedpr_trace, exitdepth;
+ int restorevm_tempstringsbuf_cursize;
+ double calltime;
+ double tm, starttm;
+
+ calltime = Sys_DoubleTime();
if (!fnum || fnum >= (unsigned int)prog->progs->numfunctions)
{
- if (prog->self && PRVM_G_INT(prog->self->ofs))
- PRVM_ED_Print(PRVM_PROG_TO_EDICT(PRVM_G_INT(prog->self->ofs)));
- PRVM_ERROR ("PRVM_ExecuteProgram: %s", errormessage);
+ if (prog->globaloffsets.self >= 0 && PRVM_GLOBALFIELDVALUE(prog->globaloffsets.self)->edict)
+ PRVM_ED_Print(PRVM_PROG_TO_EDICT(PRVM_GLOBALFIELDVALUE(prog->globaloffsets.self)->edict), NULL);
+ PRVM_ERROR ("MVM_ExecuteProgram: %s", errormessage);
}
f = &prog->functions[fnum];
+ // after executing this function, delete all tempstrings it created
+ restorevm_tempstringsbuf_cursize = vm_tempstringsbuf.cursize;
+
prog->trace = prvm_traceqc.integer;
// we know we're done when pr_depth drops to this
// (when the function exits or jumps, the (st - startst) integer value is
// added to the function's profile counter)
startst = st;
+ starttm = calltime;
// instead of counting instructions, we count jumps
jumpcount = 0;
// add one to the callcount of this function because otherwise engine-called functions aren't counted
chooseexecprogram:
cachedpr_trace = prog->trace;
- if (prvm_statementprofiling.integer)
+ if (prvm_statementprofiling.integer || prog->trace)
{
-#define PRVMSTATEMENTPROFILING 1
- if (prvm_boundscheck.integer)
+#define PRVMSLOWINTERPRETER 1
+ if (prvm_timeprofiling.integer)
{
-#define PRVMBOUNDSCHECK 1
- if (prog->trace)
- {
-#define PRVMTRACE 1
+#define PRVMTIMEPROFILING 1
#include "prvm_execprogram.h"
-#undef PRVMTRACE
- }
- else
- {
+#undef PRVMTIMEPROFILING
+ }
+ else
+ {
#include "prvm_execprogram.h"
- }
-#undef PRVMBOUNDSCHECK
+ }
+#undef PRVMSLOWINTERPRETER
+ }
+ else
+ {
+ if (prvm_timeprofiling.integer)
+ {
+#define PRVMTIMEPROFILING 1
+#include "prvm_execprogram.h"
+#undef PRVMTIMEPROFILING
}
else
{
- if (prog->trace)
- {
-#define PRVMTRACE 1
#include "prvm_execprogram.h"
-#undef PRVMTRACE
- }
- else
- {
+ }
+ }
+
+cleanup:
+ if (developer_insane.integer && vm_tempstringsbuf.cursize > restorevm_tempstringsbuf_cursize)
+ Con_DPrintf("MVM_ExecuteProgram: %s used %i bytes of tempstrings\n", PRVM_GetString(prog->functions[fnum].s_name), vm_tempstringsbuf.cursize - restorevm_tempstringsbuf_cursize);
+ // delete tempstrings created by this function
+ vm_tempstringsbuf.cursize = restorevm_tempstringsbuf_cursize;
+
+ f->totaltime += (Sys_DoubleTime() - calltime);
+
+ SV_FlushBroadcastMessages();
+}
+
+/*
+====================
+CLVM_ExecuteProgram
+====================
+*/
+void CLVM_ExecuteProgram (func_t fnum, const char *errormessage)
+{
+ dstatement_t *st, *startst;
+ mfunction_t *f, *newf;
+ prvm_edict_t *ed;
+ prvm_eval_t *ptr;
+ int jumpcount, cachedpr_trace, exitdepth;
+ int restorevm_tempstringsbuf_cursize;
+ double calltime;
+ double tm, starttm;
+
+ calltime = Sys_DoubleTime();
+
+ if (!fnum || fnum >= (unsigned int)prog->progs->numfunctions)
+ {
+ if (prog->globaloffsets.self >= 0 && PRVM_GLOBALFIELDVALUE(prog->globaloffsets.self)->edict)
+ PRVM_ED_Print(PRVM_PROG_TO_EDICT(PRVM_GLOBALFIELDVALUE(prog->globaloffsets.self)->edict), NULL);
+ PRVM_ERROR ("CLVM_ExecuteProgram: %s", errormessage);
+ }
+
+ f = &prog->functions[fnum];
+
+ // after executing this function, delete all tempstrings it created
+ restorevm_tempstringsbuf_cursize = vm_tempstringsbuf.cursize;
+
+ prog->trace = prvm_traceqc.integer;
+
+ // we know we're done when pr_depth drops to this
+ exitdepth = prog->depth;
+
+// make a stack frame
+ st = &prog->statements[PRVM_EnterFunction (f)];
+ // save the starting statement pointer for profiling
+ // (when the function exits or jumps, the (st - startst) integer value is
+ // added to the function's profile counter)
+ startst = st;
+ starttm = calltime;
+ // instead of counting instructions, we count jumps
+ jumpcount = 0;
+ // add one to the callcount of this function because otherwise engine-called functions aren't counted
+ prog->xfunction->callcount++;
+
+chooseexecprogram:
+ cachedpr_trace = prog->trace;
+ if (prvm_statementprofiling.integer || prog->trace)
+ {
+#define PRVMSLOWINTERPRETER 1
+ if (prvm_timeprofiling.integer)
+ {
+#define PRVMTIMEPROFILING 1
+#include "prvm_execprogram.h"
+#undef PRVMTIMEPROFILING
+ }
+ else
+ {
#include "prvm_execprogram.h"
- }
}
-#undef PRVMSTATEMENTPROFILING
+#undef PRVMSLOWINTERPRETER
}
else
{
- if (prvm_boundscheck.integer)
+ if (prvm_timeprofiling.integer)
{
-#define PRVMBOUNDSCHECK 1
- if (prog->trace)
- {
-#define PRVMTRACE 1
+#define PRVMTIMEPROFILING 1
#include "prvm_execprogram.h"
-#undef PRVMTRACE
- }
- else
- {
+#undef PRVMTIMEPROFILING
+ }
+ else
+ {
#include "prvm_execprogram.h"
- }
-#undef PRVMBOUNDSCHECK
+ }
+ }
+
+cleanup:
+ if (developer_insane.integer && vm_tempstringsbuf.cursize > restorevm_tempstringsbuf_cursize)
+ Con_DPrintf("CLVM_ExecuteProgram: %s used %i bytes of tempstrings\n", PRVM_GetString(prog->functions[fnum].s_name), vm_tempstringsbuf.cursize - restorevm_tempstringsbuf_cursize);
+ // delete tempstrings created by this function
+ vm_tempstringsbuf.cursize = restorevm_tempstringsbuf_cursize;
+
+ f->totaltime += (Sys_DoubleTime() - calltime);
+
+ SV_FlushBroadcastMessages();
+}
+#endif
+
+/*
+====================
+SVVM_ExecuteProgram
+====================
+*/
+void SVVM_ExecuteProgram (func_t fnum, const char *errormessage)
+{
+ dstatement_t *st, *startst;
+ mfunction_t *f, *newf;
+ prvm_edict_t *ed;
+ prvm_eval_t *ptr;
+ int jumpcount, cachedpr_trace, exitdepth;
+ int restorevm_tempstringsbuf_cursize;
+ double calltime;
+ double tm, starttm;
+
+ calltime = Sys_DoubleTime();
+
+ if (!fnum || fnum >= (unsigned int)prog->progs->numfunctions)
+ {
+ if (prog->globaloffsets.self >= 0 && PRVM_GLOBALFIELDVALUE(prog->globaloffsets.self)->edict)
+ PRVM_ED_Print(PRVM_PROG_TO_EDICT(PRVM_GLOBALFIELDVALUE(prog->globaloffsets.self)->edict), NULL);
+ PRVM_ERROR ("SVVM_ExecuteProgram: %s", errormessage);
+ }
+
+ f = &prog->functions[fnum];
+
+ // after executing this function, delete all tempstrings it created
+ restorevm_tempstringsbuf_cursize = vm_tempstringsbuf.cursize;
+
+ prog->trace = prvm_traceqc.integer;
+
+ // we know we're done when pr_depth drops to this
+ exitdepth = prog->depth;
+
+// make a stack frame
+ st = &prog->statements[PRVM_EnterFunction (f)];
+ // save the starting statement pointer for profiling
+ // (when the function exits or jumps, the (st - startst) integer value is
+ // added to the function's profile counter)
+ startst = st;
+ starttm = calltime;
+ // instead of counting instructions, we count jumps
+ jumpcount = 0;
+ // add one to the callcount of this function because otherwise engine-called functions aren't counted
+ prog->xfunction->callcount++;
+
+chooseexecprogram:
+ cachedpr_trace = prog->trace;
+ if (prvm_statementprofiling.integer || prog->trace)
+ {
+#define PRVMSLOWINTERPRETER 1
+ if (prvm_timeprofiling.integer)
+ {
+#define PRVMTIMEPROFILING 1
+#include "prvm_execprogram.h"
+#undef PRVMTIMEPROFILING
}
else
{
- if (prog->trace)
- {
-#define PRVMTRACE 1
#include "prvm_execprogram.h"
-#undef PRVMTRACE
- }
- else
- {
+ }
+#undef PRVMSLOWINTERPRETER
+ }
+ else
+ {
+ if (prvm_timeprofiling.integer)
+ {
+#define PRVMTIMEPROFILING 1
+#include "prvm_execprogram.h"
+#undef PRVMTIMEPROFILING
+ }
+ else
+ {
#include "prvm_execprogram.h"
- }
}
}
+
+cleanup:
+ if (developer_insane.integer && vm_tempstringsbuf.cursize > restorevm_tempstringsbuf_cursize)
+ Con_DPrintf("SVVM_ExecuteProgram: %s used %i bytes of tempstrings\n", PRVM_GetString(prog->functions[fnum].s_name), vm_tempstringsbuf.cursize - restorevm_tempstringsbuf_cursize);
+ // delete tempstrings created by this function
+ vm_tempstringsbuf.cursize = restorevm_tempstringsbuf_cursize;
+
+ f->totaltime += (Sys_DoubleTime() - calltime);
+
+ SV_FlushBroadcastMessages();
}