function progress_set_intervalled_progress in Progress 6
Same name and namespace in other branches
- 8 progress.module \progress_set_intervalled_progress()
- 7 progress.module \progress_set_intervalled_progress()
Set intervalled progress Use when you don't need to spam the progress table every time.
Parameters
string $name: Name of progress
string $message: Message for progress
double $progress: Current progress (0 - 1)
double $interval: Interval in seconds
Return value
mixed Result from db_query()
File
- ./
progress.module, line 75 - Progress framework for keeping track of progresses
Code
function progress_set_intervalled_progress($name, $message, $progress, $interval = NULL) {
static $set = array();
if (isset($interval, $set[$name])) {
if ($set[$name] + $interval > microtime(TRUE)) {
return TRUE;
}
}
$result = progress_set_progress($name, $message, $progress);
$set[$name] = microtime(TRUE);
return $result;
}