Here is two function that creates 1000 files inside 1000 folders in two different fashion:
First Method
function createEverything() {
for($i = 1; $i == 1000; $i++) {
mkdir('test/'.$i);
file_put_contents("test/".$i."/".$i.".txt", time());
}
}
Second Method
function createEverything() {
for($i = 1; $i == 1000; $i++) {
exec("mkdir test/".$i);
exec("touch test/".$i."/".$i.".txt");
exec("echo ".time()." >> test/".$i."/".$i.".txt");
}
}
The second method utilized the unix commands in order to create 1000 files inside 1000 folders.
Now my question is how i can get the CPU information's, RAM uses and other performance related informations separately for this two separate method, so i can compare which one is appropriate for me?
Aucun commentaire:
Enregistrer un commentaire