Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
3 added explanation
source | link

CJam, 15

{e3es+{_es>}g;}

This is a block that can be executed or stored into a variable (thus becoming a named function). Dennis and Mr Consensus agree that counting only the block is acceptable :)

Explanation:

e3       multiply the argument by 1000 (to get milliseconds)
es       get the current timestamp in milliseconds
+        add the values, obtaining the stopping time
{…}g     do…while
  _      duplicate the stopping time
  es>    check if we reached that time yet (loop condition)
;        discard the stopping time

Try it online

CJam, 15

{e3es+{_es>}g;}

This is a block that can be executed or stored into a variable (thus becoming a named function). Dennis and Mr Consensus agree that counting only the block is acceptable :)

Try it online

CJam, 15

{e3es+{_es>}g;}

This is a block that can be executed or stored into a variable (thus becoming a named function). Dennis and Mr Consensus agree that counting only the block is acceptable :)

Explanation:

e3       multiply the argument by 1000 (to get milliseconds)
es       get the current timestamp in milliseconds
+        add the values, obtaining the stopping time
{…}g     do…while
  _      duplicate the stopping time
  es>    check if we reached that time yet (loop condition)
;        discard the stopping time

Try it online

2 reduced to block
source | link

CJam, 1815

{e3es+{_es>}g;}:F;

It's not very clear how to count functions in CJam, so I used the most conservative approachThis is a block that can be executed or stored into a variable -(thus becoming a full definitionnamed function). Dennis and Mr Consensus agree that doesn't changecounting only the stack.block is acceptable :)

Try it onlineTry it online

CJam, 18

{e3es+{_es>}g;}:F;

It's not very clear how to count functions in CJam, so I used the most conservative approach - a full definition that doesn't change the stack.

Try it online

CJam, 15

{e3es+{_es>}g;}

This is a block that can be executed or stored into a variable (thus becoming a named function). Dennis and Mr Consensus agree that counting only the block is acceptable :)

Try it online

1
source | link

CJam, 18

{e3es+{_es>}g;}:F;

It's not very clear how to count functions in CJam, so I used the most conservative approach - a full definition that doesn't change the stack.

Try it online