1
我試圖找出如何找到多少時間是我的應用程序運行,但所有我能看到的是:C#的Linux的MonoDevelop如何讓時間
Clock()
timersub()
和一些類似的東西,但我不能使用它們....
我必須在我的代碼中包含哪些內容才能使用它們?
像我包括:
using System.Collections.Generic;
,所以我可以使用:
List<int> ints = new List<int>();
,如果我做的:
#include <time.h> // I get: Wrong preprocessor directive
此外,我需要浮點自啓動和我做得到:
System.DateTime.Now; // - not float but sealed struct
你試過'Stopwatch'其良好的時間 –
保持跟蹤「此外,我需要的浮動,因爲起點起來「 - 這並不意味着太多。你想從應用程序啓動以來的時間?或者自設備啓動以來?或者活動啓動?爲什麼你需要一些浮點格式? –
注意:'#include'不是C#。 'System.DateTime.Now.Ticks'不好? 'n/10000000M'會給你幾分之一秒。 (注意,在大多數系統中,值只更新每個'20ms'左右) –
2014-03-13 15:12:51