Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试编写一个检测用户活动的应用程序。如果用户空闲五分钟左右,计算机将关闭。我可以在标签中显示空闲时间,但我只能以毫秒为单位。我想在几分钟内展示它,如果有人能给我一些关于此的信息,那将非常有帮助。任何帮助将不胜感激。
好吧,如果您有以毫秒为单位的空闲时间,为什么不直接转换它呢?
idleMinutes = idleMilliseconds / 60000;