diff --git a/examples/100_random.php b/examples/100_random.php new file mode 100644 index 0000000..ed2bb81 --- /dev/null +++ b/examples/100_random.php @@ -0,0 +1,53 @@ +execute($item['id'], $item, $exclude); +} +$finish = microtime(true); + +// process results +$diff = $finish - $start; +fwrite(STDOUT, sprintf("\nItems processed: %s", $actualItems)); +fwrite(STDOUT, sprintf("\nExecution Time: %s", $diff)); +fwrite(STDOUT, sprintf("\nAvg. Time/Item: %s", $diff / $actualItems)); +fwrite(STDOUT, "\n"); diff --git a/examples/data/random_data.inc.php b/examples/data/random_data.inc.php new file mode 100644 index 0000000..dac35fb --- /dev/null +++ b/examples/data/random_data.inc.php @@ -0,0 +1,95 @@ + $code, + 'data' => SimpleVal::create(), + ]; + } + + return [ + 'id' => mt_rand(100, 10000), + 'owner' => User::create(), + 'slug' => randomStr(), + 'name' => randomStr(), + 'reference' => SimpleVal::create(), + 'tags' => [ + SimpleVal::create(), + SimpleVal::create(), + ], + 'categories' => [ + SimpleVal::create(), + SimpleVal::create(), + ], + 'fields' => $fields, + 'details' => randomStr(500), + 'createdAt' => new DateTime('-10 days'), + 'createdBy' => User::create(), + 'updatedAt' => new DateTime('now'), + 'updatedBy' => User::create(), + ]; +};