fork(1) download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace TimespanTest
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. DateTime A = DateTime.Now;
  13. System.Threading.Thread.Sleep(100);
  14.  
  15. TimeSpan B = DateTime.Now.Subtract(A);
  16. System.Threading.Thread.Sleep(1000);
  17. TimeSpan C = DateTime.Now.Subtract(A);
  18.  
  19. TimeSpan D = C.Subtract(B);
  20.  
  21. Console.WriteLine("{0}", D.ToString());
  22.  
  23. return ;
  24. }
  25. }
  26. }
  27.  
Success #stdin #stdout 0.03s 38088KB
stdin
Standard input is empty
stdout
00:00:01.0001000