Discuss (FTP) and (SFTP, FTPS and SCP), our Java file transfer clients.
no avatar
User

brijesh

Posts

2

Joined

Wed Mar 25, 2009 2:26 am

Time taken for file upload/download

by brijesh » Wed Mar 25, 2009 2:29 am

Hi,
I am uploading/downloading a file and i want total time taken for uploading/downloading a file. How can i get it?


Thanks & Regards,
Brijesh
no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

Re: Time taken for file upload/download

by support2 » Wed Mar 25, 2009 7:32 am

The simplest way is System.currentTimeMillis() before and after the transfer.
no avatar
User

brijesh

Posts

2

Joined

Wed Mar 25, 2009 2:26 am

Re: Time taken for file upload/download

by brijesh » Wed Mar 25, 2009 2:49 pm

But what if i have used uploadFileAsync() method for uploading? In that case time taken is 0.
no avatar
User

xiaoyu1985ban

Posts

30

Joined

Wed Mar 18, 2009 1:31 am

by xiaoyu1985ban » Wed Mar 25, 2009 6:33 pm

By the way,if an error occurs while downloading,when resuming transfer, the way invoking System.currentTimeMillis() before and after the transfer will not work.
no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

by support2 » Wed Mar 25, 2009 6:55 pm

Take a look at the events - Downloading and Downloaded, similar for uploading. You can set up the events to record the time taken.

Who is online

Users browsing this forum: No registered users and 18 guests

Powered by phpBB ® | phpBB3 Style by KomiDesign