<!DOCTYPE html>
<html>
<head>
<script src="script.js"></script>
</head>
<body>
<input type="button" onclick="limpiarCampos()"></input>
</body>
</html>
// Code goes here
var firstCall = true;
function limpiarCampos() {
alert("Ejecutando limpiarCampos()");
if (firstCall) {
setTimeout(limpiarCampos, 3000);
firstCall = false;
} else {
firstCall = true;
}
}