I am currently working on capturing timestamps every time a page is loaded and when the user exits the page. I am able to capture the timestamp on OnInit, but having an issue with OnDestroy as it shows the same timestamp as when the page was accessed.
entryTime = Date.now();
exitTime = new Date();
ngOnInit(): void {
console.log(this.entryTime);
}
ngOnDestroy(): void {
console.log(this.exitTime);
}