Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
855 B

  1. //===== Copyright � 1996-2006, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose: event time stamping for hammer
  4. //
  5. //===========================================================================//
  6. #include "stdafx.h"
  7. #include "tier0/platform.h"
  8. #include "mathlib/mathlib.h"
  9. #include "hammer.h"
  10. // memdbgon must be the last include file in a .cpp file!!!
  11. #include <tier0/memdbgon.h>
  12. static int g_EventTimeCounters[100];
  13. static float g_EventTimes[100];
  14. void SignalUpdate(int ev)
  15. {
  16. g_EventTimes[ev]=Plat_FloatTime();
  17. g_EventTimeCounters[ev]++;
  18. }
  19. int GetUpdateCounter(int ev)
  20. {
  21. return g_EventTimeCounters[ev];
  22. }
  23. float GetUpdateTime(int ev)
  24. {
  25. return g_EventTimes[ev];
  26. }
  27. void SignalGlobalUpdate(void)
  28. {
  29. float stamp=Plat_FloatTime();
  30. for(int i=0;i<NELEMS(g_EventTimes);i++)
  31. {
  32. g_EventTimes[i] = stamp;
  33. g_EventTimeCounters[i]++;
  34. }
  35. }