mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:01:24 +00:00
Use now() helper for calculating scripts runtime
This commit is contained in:
@@ -13,11 +13,11 @@ $movies = DB::select('SELECT title FROM xxxinfo WHERE cover = 0');
|
||||
|
||||
echo $c->primary('Updating '.number_format(\count($movies)).' XXX movie covers.');
|
||||
foreach ($movies as $mov) {
|
||||
$starttime = microtime(true);
|
||||
$starttime = now()->timestamp;
|
||||
$mov = $movie->updateXXXInfo($mov->title);
|
||||
|
||||
// sleep so that it's not ddos' the site
|
||||
$diff = floor((microtime(true) - $starttime) * 1000000);
|
||||
$diff = floor((now()->timestamp - $starttime) * 1000000);
|
||||
if (333333 - $diff > 0) {
|
||||
echo "\nsleeping\n";
|
||||
usleep(333333 - $diff);
|
||||
|
||||
Reference in New Issue
Block a user