-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.php
executable file
·37 lines (33 loc) · 1.11 KB
/
run.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
$dir = opendir('.');
$dimensions = array(
array(280, 150),
array(210, 210),
array(200, 150),
array(150, 150)
);
$benchmark = array();
while ($file = readdir($dir)) {
if (is_dir($file) && $file[0]!='.') {
if (file_exists($file.'/plater.conf')) {
echo "* Processing $file...\n";
$benchmark[$file] = array();
foreach ($dimensions as $dimension) {
list($w, $h) = $dimension;
$t = microtime(true);
`rm $file/plate_*.stl 2> /dev/null`;
`plater -t 4 -W $w -H $h -s 1.75 $file/plater.conf 2> /dev/null`;
$plates = count(explode("\n",`ls $file/plate_*.stl 2> /dev/null`))-1;
$e = round(microtime(true)-$t,2);
$benchmark[$file][] = array(
'width' => $w,
'height' => $h,
'time' => $e,
'plates' => $plates
);
echo "~> Width: $w, Height: $h, Time: $e, Plates: $plates\n";
}
}
}
}
fwrite(STDERR, var_export($benchmark, true));