Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5868

StopWatch issue

$
0
0

@ivelin.peychev wrote:

Hi,

Why is this code immediately stopped when run inside Rhino.

import System

from System.Diagnostics import Stopwatch


def Main():
    zSW = Stopwatch.StartNew()
    
    
    print "StopWatch is running."
    print "(Press Enter to stop the StopWatch.)"
    while System.Console.Read() != 'q':#True:
        zSW.Stop()
        print "Elapsed time: ",zSW.Elapsed.ToString()
        return 0
        
        
def OnTimedEvent(sender,e):
    #print "Yello!"
    print e.SignalTime
    print "{0}".format(System.DateTime.Now.Millisecond)

    
if __name__=="__main__":
    Main()

Posts: 16

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 5868

Trending Articles