Uhmm.. Just want to point out that it's not good to have the clock var named same as the function..
function time() --Function name is time
local clock = textutils.formatTime(os.time(), true) -- This var was called time also, And it could error when you try to print it or something then..
local w = term.getSize()
term.setCursorPos(w - #time + 1, 1)
print(clock) -- Here it printed the var called "time", As explained the same name as the function, Think it will error
end
And for you updating problem.. You could use a timer, And my guess you have some events pausing the loop and waiting for an event etc.
Here's an example
clockTimer = os.startTimer(.8) -- Start the timer for the first time
while true do
evt, p1, mX, mY = os.pullEvent()
if evt == "key" then
-- Do something
elseif evt == "timer" then
clockTimer = os.startTimer(.8) -- Restart the timer when it has ran
end
end
It's as simple as that, So all you have todo is to start a timer and restart it every time it has ran

I think 0.8 is a MC second so you know.