AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Getting file copy/move speed

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
tuna



Joined: 03 Oct 2007
Posts: 155
Location: UK

PostPosted: Mon Dec 28, 2009 7:07 pm    Post subject: Getting file copy/move speed Reply with quote

Is it possible to access information on the speed at which a file is being written during a file operation? Many scripts have relied upon simply timing the file operation itself then dividing the file size by the result, but this can only be done upon completion of the operation.

I can only think of splitting a file up into a number of arbitrarily small files so that calculations can be made after each smaller file is operated upon, and merging the small files together at the end. But I presume this would increase the overall time for the operation considerable, especially if the quantity of files or file sizes were large.

I think I'm probably missing a trick here so if anyone can point me in the right direction, I'd be very grateful.

Thanks
Back to top
View user's profile Send private message
Ace Coder



Joined: 26 Oct 2009
Posts: 361

PostPosted: Mon Dec 28, 2009 9:33 pm    Post subject: Reply with quote

To find the time it takes to write a file, I would do it this way:
Code:

;Pseudo-Code
;Not real code
FileApeend,somefile
start:=A_TickCount
Loop
{
If fileexists
 break
}
TotalTime:=A_TickCount-Start
Get the file size
Divide the file size by TotalTime
This gives you the average time per byte.


I get a feeling this isn't what you mean, but without a clearer explanation I can't help more than this.
_________________
Check out the new AHK forum competition!
Back to top
View user's profile Send private message
tuna



Joined: 03 Oct 2007
Posts: 155
Location: UK

PostPosted: Mon Dec 28, 2009 9:55 pm    Post subject: Reply with quote

Thanks - what I mean is, for example, when my script is copying a 4GB file, I can get info on how many MB/s the file is currently copying at.
Back to top
View user's profile Send private message
Ace Coder



Joined: 26 Oct 2009
Posts: 361

PostPosted: Tue Dec 29, 2009 12:17 am    Post subject: Reply with quote

I don't know off the top of my head, and 10 minutes of Googling has yielded nothing useful.
I don't have the time to really find your answer at this time, maybe next month.

If I did have the time I would use Google and the Microsoft website.
Here are some keywords that may be useful:
Download Rate
Download Speed
Bytes Per Second
Kb/s

Good Luck.
_________________
Check out the new AHK forum competition!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group