1. c#中計算時間方法:
// example2: Stopwatch class
System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
sw.Start();
System.Threading.Thread.Sleep(time_cap);
sw.Stop();
TimeSpan ts2 = sw.Elapsed;
Console.WriteLine("example2 time {0}", ts2.TotalMilliseconds);
2. 讀取date.csv中的數據至List<string> STRS.
List<string> STRS = new List<string>();
StreamReader sr = new StreamReader("date.csv", Encoding.Default);
String line;
while ((line = sr.ReadLine()) != null)
{
//Console.WriteLine(line.ToString());
STRS.Add(line.ToString());
}
return STRS;