Variable doesnt seem to update unless it is being displayed somewhere

currenttime = currenttime.AddSeconds(Time.deltaTime);

		if (upgradingengine.Eng.Name != "Default" && currenttime.CompareTo(upgradingengine.FinTime) == 1)
		{
			BaseClasses.AddToResearchedList(upgradingengine.Eng.Name);
			Debug.Log("Finished research on " + upgradingengine.Eng.Name);
		 	upgradingengine = new BaseClasses.UpgradingEngine(new BaseClasses.Engine("Default"), DateTime.Now);
		}

Above code only works if currenttime is being displayed somewhere (either on screen in a textbox or in a debug.log) I honestly have no clue why this is happening. I figure if i have to i can just have a display box off screen but that doesnt seem to be the proper way of fixing this. Any help would be greatly appreciated.

Just wanted to close this questions out i finally figured out what i was doing wrong. I was deactivating the object running the calculation for time while in the menu.