public static TimeScope GetTimeScope(string name, TimeScope.EProfileFlag flags = TimeScope.EProfileFlag.FlagsAll, bool createWhenNotFound = true) { TimeScope counter; if (Instance.mCounters.TryGetValue(name, out counter)) { return(counter); } else if (createWhenNotFound || SDK_v3dSampMgr_PureFindSamp(Instance.CoreObject, name).GetPointer() != IntPtr.Zero) { counter = new TimeScope(SDK_v3dSampMgr_FindSamp(Instance.CoreObject, name), flags); Instance.mCounters[name] = counter; return(counter); } return(null); }
public static TimeScope GetTimeScope(Type type, string method, TimeScope.EProfileFlag flags = TimeScope.EProfileFlag.FlagsAll) { return(GetTimeScope(type.FullName + "." + method)); }