Skip to content

Commit 3c5e18a

Browse files
committed
Add duration time
1 parent 49fed21 commit 3c5e18a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/Command/UploadCommand.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,17 @@ private function uploadFiles(array $files, OutputInterface $output): void
7979
$fileSizeMB = round($fileSize / (1024 * 1024), 2);
8080

8181
$output->writeln("Uploading $file ({$fileSizeMB}MB)...");
82+
$startTime = microtime(true);
8283

83-
// Open file as a stream to avoid loading entire file into memory
8484
$fileHandle = fopen($localFile, 'r');
8585
if ($fileHandle === false) {
8686
throw new \Exception("Failed to open file: $localFile");
8787
}
8888

8989
$client->upload($file, $fileHandle);
9090

91-
$output->writeln(" ✓ Upload successful");
91+
$elapsed = round(microtime(true) - $startTime, 2);
92+
$output->writeln(" ✓ Upload successful ({$elapsed}s)");
9293
unlink($localFile);
9394
$output->writeln(" ✓ Local file deleted");
9495
}

0 commit comments

Comments
 (0)