Enzo пре 1 година
родитељ
комит
e56ac9cd87
2 измењених фајлова са 6 додато и 1 уклоњено
  1. 0 1
      services/query.service.ts
  2. 6 0
      test/test3.ts

+ 0 - 1
services/query.service.ts

@@ -18,7 +18,6 @@ export class queryService {
         const t1 = performance.now()
         const timeTakenInSeconds = (t1 - t0) / 1000;
         console.log(`Time taken: ${timeTakenInSeconds} seconds to run this function`);
-    
     }
 
     public query(storageAddress: Storage, ...conditions: Conditions[]): Observable<any> {

+ 6 - 0
test/test3.ts

@@ -113,10 +113,16 @@ function understandingOBS() {
                 handler2(data) // setTimeout will put the call into the call stack
             })
             printLog()
+            console.trace() // Checking what's in the stack call
+
+            const used = process.memoryUsage().heapUsed / 1024 / 1024;
+            console.log(`Heap memory used: ${Math.round(used * 100) / 100} MB`);
         }
     })
 }
 
+understandingOBS()
+
 /* Buffer */
 function bufferOBS() {
     /* This code defines a function called bufferOBS that creates a new observable called bufferring using