473,811 Members | 3,135 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to delay the start of a function

Hi,

My problem is that a function in the page have a rather heavy mysql query.
The query takes between 6 - 10 seconds. while the query takes place other
content on the page stop loading (Opera). Explorer and Firefox seems to
wait for the whole page to load befor drawing the site.

Is there a way to tell the browser to draw all the content except for this
function and run through this at the end, alternatively to run the process
in backround?

This functionality a want is on many sites who let you search through
multiple whois databases.
Regards,

Sindre
Aug 24 '05 #1
3 1500
Well... I can't say that I know a PHP solution to this problem.
But if I were in your shoes I would split up the content I need rendered
and the function in question. Make sure that the *function* is sitting
in its own PHP file. Then render all the other content in the main
window. And have a frame or and iframe render the other function in its
own PHP file.

hope that makes sence. As I'm tired.

Cheers,

D
sindre hiåsen wrote:
Hi,

My problem is that a function in the page have a rather heavy mysql
query. The query takes between 6 - 10 seconds. while the query takes
place other content on the page stop loading (Opera). Explorer and
Firefox seems to wait for the whole page to load befor drawing the site.

Is there a way to tell the browser to draw all the content except for
this function and run through this at the end, alternatively to run the
process in backround?

This functionality a want is on many sites who let you search through
multiple whois databases.
Regards,

Sindre

Aug 24 '05 #2
sindre hiåsen wrote:
Hi,

My problem is that a function in the page have a rather heavy mysql query.
The query takes between 6 - 10 seconds. while the query takes place other
content on the page stop loading (Opera). Explorer and Firefox seems to
wait for the whole page to load befor drawing the site.

Is there a way to tell the browser to draw all the content except for this
function and run through this at the end, alternatively to run the process
in backround?

This functionality a want is on many sites who let you search through
multiple whois databases.


Use flush() before the function.

If you're really clever with CSS or javascript, you could generate the rest
of the page apart from the query output, call the function at the end of
the script and make it appear in the middle of the page but this is not
trivial.

Alternatively fix your query/schema so it goes faster (go ask on a MySQL
group, quoting the query and the output of EXPLAIN...)

C.
Aug 24 '05 #3
On Wed, 24 Aug 2005 10:29:14 +0200, Colin McKinnon
<co************ **@andthis.mms3 .com> wrote:
sindre hiåsen wrote:
Hi,

My problem is that a function in the page have a rather heavy mysql
query.
The query takes between 6 - 10 seconds. while the query takes place
other
content on the page stop loading (Opera). Explorer and Firefox seems to
wait for the whole page to load befor drawing the site.

Is there a way to tell the browser to draw all the content except for
this
function and run through this at the end, alternatively to run the
process
in backround?

This functionality a want is on many sites who let you search through
multiple whois databases.


Use flush() before the function.

If you're really clever with CSS or javascript, you could generate the
rest
of the page apart from the query output, call the function at the end of
the script and make it appear in the middle of the page but this is not
trivial.

Alternatively fix your query/schema so it goes faster (go ask on a MySQL
group, quoting the query and the output of EXPLAIN...)

C.


Thanks to both. The IFrame should do it I think. Cant say why i havent
thought of that!

Sindre
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Aug 25 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
3038
by: Doug Thews | last post by:
I ran into an interesting re-pain delay after calling the Abort() method on a thread, but it only happens the very first time I call it. Every time afterward, there is no delay. I've got a delegate inside the UI that I call to update the progress meter. I use the Suspend() and Abort() methods based on button events. I can watch the progress meter increase just fine when the thread is running. When I select Start, I enable the Cancel...
4
2527
by: Jeremy S | last post by:
I have written an ASP.NET application that performs very well. I make heavy use of the Cache and otherwise minimize the number of round trips to to the db. I couldn't be happier with the performance - except when the application first starts. When hitting my Web server over the Internet there is a delay waiting for the first page. I suspect that the App Pool is starting up as well as my particular ASP.NET Web application. I should note that...
18
3272
by: Max | last post by:
This is a follow-up on my previous thread concerning having the program wait for a certain date and time and then executing some code when it gets there. My question is; can I use the Sleep function from kernel32 to accomplish this? My concern is that this function takes milliseconds where my program needs to be accurate to within 5 minuets, and delays may be as long as a number of days, months or whatever. Would I run into many problems...
14
4678
by: Rene Grothmann | last post by:
I have managed to communicate between forms and Java applets. A button press sends the content of the text area to an applet, a second button gets some text from the applet and puts it into the textarea. However, at the start, there is a delay of several seconds, before any of the buttons react to a click. After the first reaction has happened, all further clicks work immediately. Is this meant to be so, or can I speed up the first...
37
8946
by: ales | last post by:
Hello, I have a problem with creation of new thread. The method .Start() of newly created thread delays current thread for 0 - 1 second. Cpu while delay occurs is about 5%. Any idea? Here is code used for measuring:
9
2359
by: krbyxtrm | last post by:
hello i have this profile for iterating empty vectors: +0.3us (microsecond) delay on intel pentium 2.4Ghz can this added delay to my application be reduced? i mean near zero delay, its very important. BTW, does anyone has another profile for this? thanks.
24
16143
by: Chen Shusheng | last post by:
Hello, I want to write a time delay function like "Timedelay(float time_lenth){}". When execute it, it will delay some seconds as long as "time_lenth" indicating. Could you help on how to write such a function? ---------------- lovely newsgroup ----------------
0
1712
by: bdtmike | last post by:
I'm using VS2005 and creating a VB.Net Winforms app. The app uses a couple of web services. For some reason, when I start the app, there is a 30 second delay when VB invokes its first web service. After that, the response time on subsequent calls is nearly intantaneous. As an example, If I'm debugging and press <F5I'll get the 30 second delay on first invocation, then it's fast after that. If I stop the program and restart (F5), I get...
9
2272
by: Martin Wells | last post by:
I'm doing an embedded systems project and I'm programming it as fully- portable C89 (except of course for setting the pin values). I need to put delays in the program, in the vicinity of 250 ms. (They don't need to be exact). Does C have a built-in method of putting in delays? If not, I was thinking of defining a macro called "FLOPS" (i.e. floating-point operations per second) and then doing something like:
0
9722
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10644
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10124
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7664
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6882
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3863
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.