this goes out of scope when the original object code has run and so when the setInterval runs it points to an entirely different object which doesn't have a durationproperty.
The usual way to keep this in scope after the object code has run is to set up another field (usually called self) that will continue to point to the current object in the subsequent code.
Try this:
Code:
var Object = {
time: new Date().getTime,
duration: 2000,
self: this,
test: setInterval(function(){console.log("hi hi");}, self.duration)
}
Object.test();