You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.3 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace Apewer.Run
  7. {
  8. public class Methods
  9. {
  10. public Methods()
  11. {
  12. // FormatMinutes();
  13. }
  14. void FormatMinutes()
  15. {
  16. for (var i = 0; i < 3000; i++)
  17. {
  18. var minutes = Convert.ToInt64(i);
  19. var hours = minutes / 60;
  20. minutes = minutes % 60;
  21. var days = hours / 24;
  22. hours = hours % 24;
  23. var sb = new StringBuilder();
  24. sb.Append("已运行");
  25. if (days > 0)
  26. {
  27. sb.Append(" ");
  28. sb.Append(days.ToString());
  29. sb.Append(" 天");
  30. }
  31. if (hours > 0 || days > 0)
  32. {
  33. sb.Append(" ");
  34. sb.Append(hours.ToString());
  35. sb.Append(" 小时");
  36. }
  37. sb.Append(" ");
  38. sb.Append(minutes.ToString());
  39. sb.Append(" 分钟");
  40. var text = sb.ToString();
  41. Console.WriteLine($"{i} - {text}");
  42. }
  43. }
  44. }
  45. }