Property definitions

core $ TimeT :: defaultinit
# Time since epoch
extern class TimeT `{time_t`}

	# Returns Time since epoch from now.
	new `{ return time(NULL); `}

	# Returns Time since epoch from `i` (expressed in seconds).
	new from_i(i: Int) `{ return i; `}

	# Update current time.
	fun update `{ time(&self); `}

	# Convert `self` to a human readable String.
	fun ctime: String import CString.to_s `{
		return CString_to_s( ctime(&self) );
	`}

	# Difference in secondes from start (self if the end time)
	fun difftime(start: TimeT): Float `{ return difftime(self, start); `}

	redef fun to_s do return ctime.replace("\n", "")

	# Convert self to Int (expressed as seconds since epoch).
	fun to_i: Int `{ return (int)self; `}
end
lib/core/time.nit:74,1--98,3