Back to home page

EIC code displayed by LXR

 
 

    


Warning, /firebird/packages/firebird-ng/display/src/lib/components/perf-stats/perf-stats.component.ts is written in an unsupported language. File is not indexed.

0001 // perf-stats.component.ts
0002 import { Component, ChangeDetectionStrategy, Signal, inject } from '@angular/core';
0003 import { toSignal } from '@angular/core/rxjs-interop';
0004 import { DecimalPipe } from '@angular/common';
0005 import { PerfService, PerfLog } from '../../services/perf.service';
0006 
0007 @Component({
0008   selector: 'app-perf-stats',
0009   templateUrl: './perf-stats.component.html',
0010   imports: [
0011     DecimalPipe
0012   ],
0013   changeDetection: ChangeDetectionStrategy.OnPush,
0014   styleUrls: ['./perf-stats.component.scss']
0015 })
0016 export class PerfStatsComponent {
0017   // toSignal keeps the template updating under zoneless: the perf$ stream is
0018   // produced inside the render loop, outside any Angular scheduling.
0019   perf: Signal<PerfLog> = toSignal(inject(PerfService).perf$, {
0020     initialValue: { fps: 0, frameTime: 0, calls: 0, triangles: 0, mode: 'continuous', idle: false },
0021   });
0022 }