You can use
setTimeout
javascript function to achieve this functionality.
First of all make your marker object global (declare it outside of
initialize
function.
var map;
var marker;
var interval=40*1000;
function initialize(x,y) {
setTimeout(function(){
updateMarkerPosition(x,y);
},interval);
...
}
now create one javascript function to update position of marker on given interval;
function updateMarkerPosition(x,y){
marker.setPosition(new google.maps.LatLng(x,y));
setTimeout(function(){
updateMarkerPosition(x,y);
},interval);
}