@@ -10,35 +10,35 @@ export class TimePoint {
1010 this . #raw = secs * TimePoint . RESOLUTION + femtos ;
1111 }
1212
13- public get secs ( ) : bigint {
13+ get secs ( ) : bigint {
1414 return this . #raw / TimePoint . RESOLUTION ;
1515 }
1616
17- public get femtos ( ) : bigint {
17+ get femtos ( ) : bigint {
1818 return this . #raw % TimePoint . RESOLUTION ;
1919 }
2020
21- public equals ( other : TimePoint ) : boolean {
21+ equals ( other : TimePoint ) : boolean {
2222 return this . #raw === other . #raw;
2323 }
2424
25- public greaterThan ( other : TimePoint ) : boolean {
25+ greaterThan ( other : TimePoint ) : boolean {
2626 return this . #raw > other . #raw;
2727 }
2828
29- public lessThan ( other : TimePoint ) : boolean {
29+ lessThan ( other : TimePoint ) : boolean {
3030 return this . #raw < other . #raw;
3131 }
3232
33- public offsetByFemtos ( femtos : bigint ) : TimePoint {
33+ offsetByFemtos ( femtos : bigint ) : TimePoint {
3434 return new TimePoint ( this . secs , this . femtos + femtos ) ;
3535 }
3636
37- public differenceInFemtos ( other : TimePoint ) : bigint {
37+ differenceInFemtos ( other : TimePoint ) : bigint {
3838 return this . #raw - other . #raw;
3939 }
4040
41- public toString ( ) : string {
41+ toString ( ) : string {
4242 function groupDecimals ( num : bigint ) {
4343 const groups : string [ ] = [ ] ;
4444 if ( num === 0n ) {
@@ -70,7 +70,7 @@ export class TimePoint {
7070 }
7171 }
7272
73- public static fromString ( value : string ) : TimePoint {
73+ static fromString ( value : string ) : TimePoint {
7474 const matches = value . match ( / ^ ( \d + ) \s * ( s | m s | u s | n s | p s | f s ) $ / ) ;
7575 if ( matches === null ) {
7676 throw new SyntaxError ( `${ JSON . stringify ( value ) } is not a valid time point` ) ;
@@ -94,27 +94,27 @@ export class TimePoint {
9494 }
9595 }
9696
97- public static fromCXXRTL ( value : string ) : TimePoint {
97+ static fromCXXRTL ( value : string ) : TimePoint {
9898 const matches = value . match ( / ^ ( \d + ) \. ( \d + ) $ / ) ;
9999 if ( matches === null ) {
100100 throw new SyntaxError ( `${ JSON . stringify ( value ) } is not a valid time point` ) ;
101101 }
102102 return new TimePoint ( BigInt ( matches [ 1 ] ) , BigInt ( matches [ 2 ] ) ) ;
103103 }
104104
105- public toCXXRTL ( ) : string {
105+ toCXXRTL ( ) : string {
106106 return `${ this . secs . toString ( ) } .${ this . femtos . toString ( ) . padStart ( 15 , '0' ) } ` ;
107107 }
108108}
109109
110110export class TimeInterval {
111111 constructor ( public begin : TimePoint , public end : TimePoint ) { }
112112
113- public static fromCXXRTL ( [ begin , end ] : [ string , string ] ) : TimeInterval {
113+ static fromCXXRTL ( [ begin , end ] : [ string , string ] ) : TimeInterval {
114114 return new TimeInterval ( TimePoint . fromCXXRTL ( begin ) , TimePoint . fromCXXRTL ( end ) ) ;
115115 }
116116
117- public toCXXRTL ( ) : [ string , string ] {
117+ toCXXRTL ( ) : [ string , string ] {
118118 return [ this . begin . toCXXRTL ( ) , this . end . toCXXRTL ( ) ] ;
119119 }
120120}
0 commit comments