3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-07 14:54:15 +00:00

WalletFiles: log how long saving the wallet took.

This commit is contained in:
Mike Hearn 2013-07-10 16:59:39 +02:00
parent 5219a42df9
commit 2b6022cd7c

View File

@ -114,6 +114,7 @@ public class WalletFiles {
}
private void saveNowInternal() throws IOException {
long now = System.currentTimeMillis();
File directory = file.getAbsoluteFile().getParentFile();
File temp = File.createTempFile("wallet", null, directory);
final Listener listener = vListener;
@ -122,6 +123,7 @@ public class WalletFiles {
wallet.saveToFile(temp, file);
if (listener != null)
listener.onAfterAutoSave(file);
log.info("Save completed in {}msec", System.currentTimeMillis() - now);
}
/** Queues up a save in the background. Useful for not very important wallet changes. */