class Greeter { greeting : string ; constructor ( message ) { this . greeting = message ; } greet ( ) { return "Hello, " + this . greeting ; } } export class TimeUnit { nanoseconds : number ; constructor ( inNs ) { this . nanoseconds = inNs ; } setMilliseconds ( ms ) { this . nanoseconds = 1000 * ms ; return this ; } setSeconds ( s ) { this . nanoseconds = 1000 * 1000 * 1000 * s ; return this ; } static zero ( ) { return new TimeUnit ( 0 ) ; } static fromMinutes ( minutes ) { return TimeUnit . fromSeconds ( 60 * minutes ) ; } static fromSeconds ( seconds ) { return TimeUnit . fromMilliseconds ( 1000 * seconds ) ; } static fromMilliseconds ( ms ) { return TimeUnit . fromNanoseconds ( 1000 * ms ) ; } static fromNanoseconds ( ns ) { return new TimeUnit ( ns ) ; } inNanoseconds ( ) { return this . nanoseconds ; } inMilliseconds ( ) { return this . nanoseconds / 1000.0 ; } inSeconds ( ) { return this . nanoseconds / 1000.0 / 1000.0 ; } }