how slow is this check

  • Thread starter Thread starter SalahChafai
  • Start date Start date
S

SalahChafai

Guest
i need to check if a virtual method is overridden in a certain script so i made this function,

public bool IsMethodOverridden(string methodName)
{
var mi = this.GetType().GetMethod(methodName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly);
return mi != null;
}
however i'm not really sure about how fast this method is, i tried using visual studio to see how much it takes to run but that doesn't really show much, is it fast enough to be used every frame twice without a noticeable performance impact

Continue reading...
 
Back
Top