return timer->QueryInterface(kITimerIID, (void **) aInstancePtrResult);
return rv;
static nsresult NewTimer(const nsCID & aClass,                         nsITimer ** aInstancePtrResult){  NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");    if (nsnull == aInstancePtrResult)     return NS_ERROR_NULL_POINTER;    nsresult   rv = NS_ERROR_FAILURE;  nsITimer * timer = nsnull;#ifdef CHEAP_PERFORMANCE_MEASURMENT  sCreateInstanceStartTime = PR_Now();#endif#ifdef CACHE_FACTORY  static nsIFactory * factory = nsnull;  if (nsnull == factory)  {    nsresult frv = FindFactory(aClass,&factory);    NS_ASSERTION(NS_SUCCEEDED(frv),"Could not find timer factory.");    NS_ASSERTION(nsnull != factory,"Could not instanciate timer factory.");  }  if (nsnull != factory)  {	rv = factory->CreateInstance(NULL,								 kITimerIID,								 (void **)& timer);  }#else  rv = nsComponentManager::CreateInstance(aClass,                                          nsnull,                                          kITimerIID,                                          (void **)& timer);#endif#ifdef CHEAP_PERFORMANCE_MEASURMENT  sCreateInstanceEndTime = PR_Now();#endif  NS_ASSERTION(NS_SUCCEEDED(rv),"Could not instanciate a timer.");  if (nsnull == timer)     return NS_ERROR_OUT_OF_MEMORY;    return timer->QueryInterface(kITimerIID, (void **) aInstancePtrResult);}