mirror of
https://github.com/bitinflow/expose.git
synced 2026-03-13 13:35:54 +00:00
Merge pull request #74 from okaufmann/fix-remaining-time
fix remaining time calculation
This commit is contained in:
@@ -108,10 +108,11 @@ class Client
|
||||
$this->loop->addPeriodicTimer(1, function () use ($data, $timeoutSection) {
|
||||
$this->timeConnected++;
|
||||
|
||||
$carbon = Carbon::createFromFormat('s', str_pad($data->length * 60 - $this->timeConnected, 2, 0, STR_PAD_LEFT));
|
||||
$secondsRemaining = $data->length * 60 - $this->timeConnected;
|
||||
$remaining = Carbon::now()->diff(Carbon::now()->addSeconds($secondsRemaining));
|
||||
|
||||
$timeoutSection->clear();
|
||||
$timeoutSection->writeln('Remaining time: '.$carbon->format('H:i:s'));
|
||||
$timeoutSection->writeln('Remaining time: '.$remaining->format('%H:%I:%S'));
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user