Jump to content

[Duda] setTimer


Mixters

Recommended Posts

Podes usar esta funcion que cree:

function convertTime ( ms ) 
    if ( ms and type ( ms ) == "number" ) then 
        local sec = math.floor ( ms / 1000 ) 
        local ms = ( ms % 1000 ) 
  
        local mins = math.floor ( sec / 60 ) 
        local sec = ( sec % 60 ) 
  
        local hours = math.floor ( mins / 60 ) 
        local mins = ( mins % 60 ) 
  
        local days = math.floor ( hours / 24 ) 
        local hours = ( hours % 24 ) 
  
        return days, hours, mins, sec 
    else 
        return 0, 0, 0, 0 
    end 
end 

Convierte milisegundos en dias, horas, minutos, segundos.

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...