cara memicu fungsi setelah berhenti menulis di acara input teks jQuery

var x_timer;
$("#input-box"). keyup(function (e){
clearTimeout(x_timer);
var user_name = $(this). val();
x_timer = setTimeout(function(){
// callback_function();
console. log("user stopped");
}, 1000);
Xenophobic Xenomorph