Skip to end of metadata
Go to start of metadata

how to not Script a call to system.date.now() 

Step-by-step guide

very simple Scripting 

  1. not so good Script

    def test(time=system.date.now()):
    	print time
    import time
    for i in range (10):
    	test()
    	time.sleep(1)

    returns

    Thu Oct 08 09:23:13 PDT 2020
    Thu Oct 08 09:23:13 PDT 2020
    Thu Oct 08 09:23:13 PDT 2020
    Thu Oct 08 09:23:13 PDT 2020
    Thu Oct 08 09:23:13 PDT 2020
    Thu Oct 08 09:23:13 PDT 2020
    Thu Oct 08 09:23:13 PDT 2020
    Thu Oct 08 09:23:13 PDT 2020
    Thu Oct 08 09:23:13 PDT 2020
    Thu Oct 08 09:23:13 PDT 2020
      
  2. much better Script

    def test(time=None):
    	if time is None:
    		time = system.date.now() 
    	print time
    import time
    for i in range (10):
    	test()
    	time.sleep(1)

    returns

    Thu Oct 08 09:25:07 PDT 2020
    Thu Oct 08 09:25:08 PDT 2020
    Thu Oct 08 09:25:09 PDT 2020
    Thu Oct 08 09:25:10 PDT 2020
    Thu Oct 08 09:25:11 PDT 2020
    Thu Oct 08 09:25:12 PDT 2020
    Thu Oct 08 09:25:13 PDT 2020

Formatting Time Values
Tracing a Trace Graph Time Out
MES Loggers and how to use them