2017-02-28 1 views
-1

이 코드를 Windows 7의 Corona에서 실행하면 즉시 충돌이 발생합니다. 그것은 ZeroBrane에서 잘 작동합니다. 어떤 아이디어?이 코드는 Corona가 응답하지 않게 만듭니다.

--Stopwatch-- 

local startTime 

function start() 

startTime = os.time() 
--Start the stop watch-- 
end 

function secondsEllapsed() 
    --Return the number of seconds since the stop watch was started-- 
    return os.time() - startTime 
end 

start() 

while true do 

-- Get the time ellapsed and convert it to hours, minutes and seconds 
ellapsed = secondsEllapsed() 
hours = math.floor(ellapsed/3600) 
minutes = math.floor((ellapsed - (hours * 3600))/60) 
seconds = math.floor((ellapsed - (hours * 3600) - (minutes * 60))) 

-- Print the time ellapsed to the command line 
print(hours .. 'h', minutes .. 'm', seconds .. 's') 

    end 
+1

설명이 충분하지 않아 게시 할 수 없습니다. 에 오신 것을 환영합니다. [둘러보기]를 보시기 바랍니다. 또한 [What topics about about] (http://stackoverflow.com/help/on-topic) 및 [ask] 및 [mcve]를 만드는 방법을 선택할 수 있습니다. 시도한 코드와받은 오류를 게시하십시오. 가능한 한 구체적이어야 더 나은 답변으로 이어질 것입니다. – happymacarts

답변

-1

아마도 무한 루프를 실행하기 때문에 충돌이 발생합니다.

관련 문제