473,405 Members | 2,160 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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 1487
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
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...
4
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...
18
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...
14
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...
37
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...
9
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...
24
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...
0
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....
9
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....
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...

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.