ftp_get_last_transfer_duration_ex
| FTP Functions (ftp) |
Returns the net file transfer time for the specific session.
double ftp_get_last_transfer_duration_ex( FTP *ppftp );
ftp_get_last_transfer_duration_ex returns the net transfer time for the last get command for this session in milliseconds. The net transfer duration does not include the connection overhead.
The ppFtp argument is the address of the pointer to the session identifier. It cannot be parameterized.
To get the total transfer time, use ftp_get_last_download_details_ex.
Parameterization
Standard parameterization is not available for this function.
Example
This example shows the use of the ftp session download information functions:
double duration;
unsigned long lSize, lDur;
int i;
FTP pFTP;
char * host = "ftp.microsoft.com";
// For user "user" defined on "host"://"host"\\"user"
char * user = "ftp://anonymous:email%40notset.com@ftp.microsoft.com/bussys/readme.txt"; // Note double backslash
char * pwd = "anonymous";
char * port = "21";
char ftpURL[100];
sprintf(ftpURL, "URL=ftp://%s:%s@%s:%s", user, pwd, host, port);
lr_output_message ("%s", ftpURL);
// Logon to node "host"
ftp_logon_ex (&pFTP, "LogOn", ftpURL,
LAST );
// c:\inetput\ftproot\testFiles
ftp_dir_ex (&pFTP, "T1", "PATH=/testFiles",
LAST );
ftp_get_ex (&pFTP, "Get_Small_File", "bussys/readme.txt",
LAST );
duration= ftp_get_last_transfer_duration_ex (&pFTP);
lr_output_message ("Get_Small_File Transfer took %.3f milliseconds", duration);
ftp_get_last_download_details_ex (&pFTP, &lSize, &lDur);
lr_output_message ("Get_Small_File Download of %d bytes took %d milliseconds", lSize, lDur);
ftp_get_ex (&pFTP, "Get_Large_File", "SOURCE_PATH=bussys/readme.txt",
LAST );
duration= ftp_get_last_transfer_duration_ex (&pFTP);
lr_output_message ("Get_Large_File Transfer took %.3f milliseconds", duration);
ftp_get_last_download_details_ex (&pFTP, &lSize, &lDur);
lr_output_message ("Transfer of %d bytes took %d milliseconds", lSize, lDur);
duration = ftp_get_last_handshake_duration_ex (&pFTP);
lr_output_message ("Handshake took %f milliseconds", duration);
ftp_logout_ex (&pFTP);

