System.currentTimeMillis的时间差
时间: 2023-10-25 12:03:50 浏览: 233
System.currentTimeMillis()用于返回当前的计算机时间,以毫秒为单位。可以使用它来计算某个任务的耗时。例如,通过在任务开始时记录当前时间,再在任务结束时记录当前时间,相减得到时间差,即可得到任务的执行时间。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [System.currentTimeMillis()用法及其计算方式与时间的单位转换](https://blog.csdn.net/weixin_45265547/article/details/121691236)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [java8中获取两个时间的时间差](https://blog.csdn.net/kevin_mails/article/details/87794060)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文