1. <i id='6vMbU'><tr id='6vMbU'><dt id='6vMbU'><q id='6vMbU'><span id='6vMbU'><b id='6vMbU'><form id='6vMbU'><ins id='6vMbU'></ins><ul id='6vMbU'></ul><sub id='6vMbU'></sub></form><legend id='6vMbU'></legend><bdo id='6vMbU'><pre id='6vMbU'><center id='6vMbU'></center></pre></bdo></b><th id='6vMbU'></th></span></q></dt></tr></i><div id='6vMbU'><tfoot id='6vMbU'></tfoot><dl id='6vMbU'><fieldset id='6vMbU'></fieldset></dl></div>

      1. <legend id='6vMbU'><style id='6vMbU'><dir id='6vMbU'><q id='6vMbU'></q></dir></style></legend>

        <small id='6vMbU'></small><noframes id='6vMbU'>

        • <bdo id='6vMbU'></bdo><ul id='6vMbU'></ul>
      2. <tfoot id='6vMbU'></tfoot>

        将毫秒转换为分和秒?

        时间:2023-07-27

          <small id='GZvtO'></small><noframes id='GZvtO'>

          • <bdo id='GZvtO'></bdo><ul id='GZvtO'></ul>
              <tfoot id='GZvtO'></tfoot>

                • <i id='GZvtO'><tr id='GZvtO'><dt id='GZvtO'><q id='GZvtO'><span id='GZvtO'><b id='GZvtO'><form id='GZvtO'><ins id='GZvtO'></ins><ul id='GZvtO'></ul><sub id='GZvtO'></sub></form><legend id='GZvtO'></legend><bdo id='GZvtO'><pre id='GZvtO'><center id='GZvtO'></center></pre></bdo></b><th id='GZvtO'></th></span></q></dt></tr></i><div id='GZvtO'><tfoot id='GZvtO'></tfoot><dl id='GZvtO'><fieldset id='GZvtO'></fieldset></dl></div>
                  <legend id='GZvtO'><style id='GZvtO'><dir id='GZvtO'><q id='GZvtO'></q></dir></style></legend>
                    <tbody id='GZvtO'></tbody>

                  本文介绍了将毫秒转换为分和秒?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我已经查看了以前的问题,但没有一个答案是我想要的.如何将秒表方法中的毫秒转换为分和秒?我有:

                  I have looked through previous questions, but none had the answer I was looking for. How do I convert milliseconds from a StopWatch method to Minutes and Seconds? I have:

                   watch.start();
                  

                  启动秒表和

                    watch.stop();
                  

                  停止手表.我后来有

                    watch.getTime();
                  

                  返回毫秒.我希望它在秒和分钟内返回.我该怎么做呢?我正在寻找一种无需乘以/除以 1000 的方法,而是一种使整个计算更具可读性且不易出错的方法.

                  which returns Milliseconds. I want it to return in Seconds and Minutes. How do I go about doing so? I'm looking for a way to do it without multiplying/dividing by 1000 but rather a method that will make the whole computation more readable and less error-prone.

                  推荐答案

                  我建议使用 TimeUnit.你可以这样使用它:

                  I would suggest using TimeUnit. You can use it like this:

                  long minutes = TimeUnit.MILLISECONDS.toMinutes(millis);
                  long seconds = TimeUnit.MILLISECONDS.toSeconds(millis);
                  

                  这篇关于将毫秒转换为分和秒?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何传递一个Map&lt;ObjectA,List&lt;ObjectB&am 下一篇:C++ 或 Java 中的类型转换和类型转换有什么区别

                  相关文章

                  最新文章

                  1. <tfoot id='MIkZ4'></tfoot>
                  2. <i id='MIkZ4'><tr id='MIkZ4'><dt id='MIkZ4'><q id='MIkZ4'><span id='MIkZ4'><b id='MIkZ4'><form id='MIkZ4'><ins id='MIkZ4'></ins><ul id='MIkZ4'></ul><sub id='MIkZ4'></sub></form><legend id='MIkZ4'></legend><bdo id='MIkZ4'><pre id='MIkZ4'><center id='MIkZ4'></center></pre></bdo></b><th id='MIkZ4'></th></span></q></dt></tr></i><div id='MIkZ4'><tfoot id='MIkZ4'></tfoot><dl id='MIkZ4'><fieldset id='MIkZ4'></fieldset></dl></div>

                    <small id='MIkZ4'></small><noframes id='MIkZ4'>

                    <legend id='MIkZ4'><style id='MIkZ4'><dir id='MIkZ4'><q id='MIkZ4'></q></dir></style></legend>

                        <bdo id='MIkZ4'></bdo><ul id='MIkZ4'></ul>