getElapsedRunningTime
long session.getElapsedRunningTime ( ) (professional and enterprise editions only)
Description
Get how long the current session has been running.
Parameters
This method does not receive any parameters.
Return Values
Returns number of milliseconds the scrape has been running, as a long (8-byte integer).
Change Log
Version | Description |
---|---|
4.5 | Available for professional and enterprise editions. |
If you would like to log the running time of the scraping session you should use logElapsedRunningTime.
Examples
Generic Scrape Timeout
// On pagination iterator
// Setup length to run
timeout = 1000*60*60*24; // 1 day
// Check how long scrape has been running
if (session.getElapsedRunningTime() >= timeout )
{
session.stopScraping();
}
// Setup length to run
timeout = 1000*60*60*24; // 1 day
// Check how long scrape has been running
if (session.getElapsedRunningTime() >= timeout )
{
session.stopScraping();
}
See Also
- logElapsedRunningTime() [session] - Writes the elapsed running time to the log
scraper on 07/16/2010 at 4:54 pm
- Printer-friendly version
- Login or register to post comments