小编Dan*_*man的帖子

How can I calculate the time it's taking to do something inside a method?

public void SaveTest()
    {
        savingText.GetComponent<Text>().text = "Saving !";
        Save();
        savingTextLogInfo.GetComponent<Text>().text = "";
    }
Run Code Online (Sandbox Code Playgroud)

I want somehow to start a timer or something before calling the Save() method and after the Save() method to assign the time it took into the savingTextLogInfo text.

and I'm calling the SaveTest in some places in the game so in each time I want it first to reset the result of time and then to calculate again the time it's taking to make the Save …

c# unity-game-engine

-1
推荐指数
1
解决办法
41
查看次数

标签 统计

c# ×1

unity-game-engine ×1