Ring me when our cup noodles are ready

Octave, 22 21 bytes

Saved one byte by changing from while ... end to do ... until.

tic;do
until toc>50;1

tic starts a timer, while toc returns the number of decimal seconds since the last call to tic. We initiate a do - until loop, where we'll loop until toc>50, doing nothing inside the loop. The loop stops after 50 seconds, followed by ans = 1 on the screen.

Try it on TIO (time changed to 5 seconds) or paste it into Octave Online.


MATL, 7 bytes

1`Z`50<

Try it online! The linked code uses 10 instead of 50.

Explanation

1        % Push 1
`        % Do...while
  Z`     %   Elapsed time since program started
  50     %   Push 50
  <      %   Less than?
         % End (implicit). The loop continues if top of the stack is truthy
         % Display (implicit)

Lua, 35 bytes

while os.clock()<50 do end;print'!'

odd thing is that it has exactly the same length as:

repeat until os.clock()>50;print'!'

Try it online!

Tags:

Date

Code Golf