Home » U++ Library support » U++ MT-multithreading and servers » using gates but program lags
| using gates but program lags [message #17682] |
Mon, 25 August 2008 22:01  |
TeCNoYoTTa
Messages: 138 Registered: July 2008 Location: Egypt
|
Experienced Member |
|
|
i call this function
String file_data = client.ExecuteRedirect(HttpClient::DEFAULT_MAX_REDIRECT, HttpClient::DEFAULT_RETRIES,THISBACK(progress_indecator));
and this is progress_indecator
bool Download_Manager_Window::progress_indecator(int x, int all)
{
static float timer = 0;
static float data = 0;
static double counter = 0;
double percentage;
double temp1 = x, temp2 = all;
if (all != 0)
percentage = (temp1 / temp2) * 100.0;
else
percentage = 0;
//label_DownloadDirectory.SetText(DblStr(percentage));
progress_bar.Set(percentage, 100);
timer = clock() - timer;
data = x - data;
//System("File path")
//int percantage = (x/all)*100.0;
if (data != 0 && timer != 0 && DblInt(counter) % 10 == 0)
{
//label_File.SetText(IntStr(x / 1000) + " KBs out of " + IntStr(all / 1000) + " KB ");
int temp = data / timer;
String temps = IntStr(temp);
temps += " KB/S";
label_DownloadSpeed.SetText(temps);
}
timer = clock();
data = x;
counter++;
if (x == all && counter > 10)
{
timer = 0;
data = 0;
counter = 0;
return true;
}
else
return false;
}
but the program lags till the download finish
why ??
|
|
|
|
|
|
Goto Forum:
Current Time: Thu May 07 03:16:22 GMT+2 2026
Total time taken to generate the page: 0.00745 seconds
|