简体   繁体   English

上次调用方法时如何节省时间

[英]how to save time when method was called last time

How to save the time when the a certain method was called. 如何节省调用某个方法时的时间。 If I create a Gregorian Calendar and then save the time with long variable =calendar.getTimeInMillis() this variable keeps running. 如果我创建一个公历,然后使用long variable =calendar.getTimeInMillis()保存时间,则该变量将继续运行。 How to fix this. 如何解决这个问题。

采用 :

long t1 = System.currentTimeMillis();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何定义第一次调用我的 @Scheduled 方法的时间? - How to define when my @Scheduled method should be called first time? 如何在 Reactor 的上下文中保存返回 mono 的方法,以便下次在此反应器 stream 中调用该方法时使用它? - How to save method returned mono in Reactor's Context to use it the next time the method is called in this reactor stream? 每次调用变量时如何调用方法 - How to call a method every time a variable is called 多次调用相同方法时取消方法调用 - Cancelling method calls when the same method is called multiple time 如何在每次调用方法时都不改变方法中的数组 - How to make an array from a method not change each time the method is called 弹簧控制器方法第二次调用时如何访问参数 - How to access parameter in spring controller method when its called second time Android Eclipse项目中第二次调用Java方法时如何做 - How to do sth when a java method is called “for the second time” in Android Eclipse project 如何将 map 定义为常量 object 而不是每次调用时都会创建的方法 - How to define the map as a constant object instead of a method which will be created every time when it is called Mockito 仅在第二次调用方法时返回值 - Mockito return value only when method is called for second time 模型后第二次调用 Java 方法时的 NPE - NPE when Java method is called second time after mockup
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM