Setup Auto delay timer Keyup Jquery

setup function jquery on keyup delay with timeout action to go,,,

<script src="https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js">
</script>

<input type="text" id="barcode" placeholder="###.." class="form-control" 
name="barcode" autofocus="true" autocomplete="off">

<p id="msg"></p>

<script type="text/javascript">
$(document).ready(function(){

var timeout;
var delay = 1200;

$('#barcode').keyup(function(){

$('#msg').html("<font color=#777>typing..</font>");
//go();

if(timeout) {
clearTimeout(timeout);
}

timeout = setTimeout(function() {
go_on(); // call function
}, delay);

});

function go_on() {

$('#msg').html("<font color=#777>Go! action function.</font>");

}

});

</script>
READ :  Backup Remote VPS Linux Cronjob Automatis