-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathejemplo_sin_thread.php
54 lines (51 loc) · 977 Bytes
/
ejemplo_sin_thread.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
$hora = new DateTime();
$empieza = $hora->getTimestamp();
class ejemplo
{
public function asignarDatos()
{
require 'vendor/autoload.php';
$faker = Faker\Factory::create('es_ES');
$csv = fopen("salida_datos.csv", "a");
fputcsv($csv, array(
'Id',
'Ingresado',
'Nombre(s)',
'Apellido(s)',
'Email',
'Email Empresa',
'Telefono',
'Movil',
'Ip',
'Empresa',
'Puesto',
'Direccion',
));
foreach(range(1,5000) as $i)
{
echo(".");
fputcsv($csv, array(
$i,
$faker->unixTime,
$faker->firstName,
$faker->lastName,
$faker->email,
$faker->companyEmail,
$faker->phoneNumber,
$faker->e164PhoneNumber,
$faker->ipv6,
$faker->company,
$faker->jobTitle,
$faker->address,
));
}
fclose($csv);
}
}
$iniciar = new Ejemplo();
$iniciar->asignarDatos();
$hora = new DateTime();
$termina = $hora->getTimestamp();
echo("\nTardó apróximadamente: ".($termina - $empieza)."segs.\n");
?>