Insertar dentro de 100 segundos X X X..
Hacer un INSERT que se realice dentro de X cantidad de segundos.
Con PHP se podría hacer usando un
Timer con
microtime() y comprobando el tiempo que ha pasado.
Aquí tienes un ejemplo de como usar
microtime() de la pagina oficial de php.net:
<?php
/**
* Función sencilla para repetir el comportamiento de PHP 5
*/
function microtime_float()
{
list($usec, $sec) = explode(" ", microtime());
return ((float
)$usec + (float
)$sec); }
$time_start = microtime_float();
// Dormir por un momento
usleep(100);
$time_end = microtime_float();
$time = $time_end - $time_start;
echo "No se hizo nada en $time segundos\n";
?>
MySQL tiene una función llamada
INSERT DELAYED:
The DELAYED option for the INSERT statement is a MySQL extension to standard SQL that is very useful if you have clients that cannot or need not wait for the INSERT to complete. This is a common situation when you use MySQL for logging and you also periodically run SELECT and UPDATE statements that take a long time to complete.
When a client uses INSERT DELAYED, it gets an okay from the server at once, and the row is queued to be inserted when the table is not in use by any other thread.
Another major benefit of using INSERT DELAYED is that inserts from many clients are bundled together and written in one block. This is much faster than performing many separate inserts.
Note that INSERT DELAYED is slower than a normal INSERT if the table is not otherwise in use. There is also the additional overhead for the server to handle a separate thread for each table for which there are delayed rows. This means that you should use INSERT DELAYED only when you are really sure that you need it.
Documentacion Oficial MySQLFíjate si te sirve para lo que tu quieres.
PD: Se escribe retra
sado, retra
zado, viene del verbo trazar.