Re: time() not returning Integer

new topic     » goto parent     » topic index » view thread      » older message » newer message

Tristen Wilson wrote:
> 
> If I set a variable such as a = time() and set a as an integer it returns
> a type check error. 

The time() function returns an atom and not an integer. In other words, its
value can be fractions of a second. It does not return the Time Of Day. It is
used for finding elapsed time.

  atom Start
  atom Stop

  Start = time()
  DoSomething()
  Stop = time()
  printf(1, "Duration=%f", Stop - Start)


> By using printf(fn, "%f", a) I was able to get it to 
> return even decimals. It just won't return an odd number

Show us what you mean by giving examples that you actually used and their
results.

-- 
Derek Parnell
Melbourne, Australia
Skype name: derek.j.parnell

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu