Skip to content

Commit

Permalink
week_3: Updated the comments solution and the output
Browse files Browse the repository at this point in the history
  • Loading branch information
vd89 committed Aug 14, 2022
1 parent dd3b7da commit d344171
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Week-3/exercise_3.1/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,25 @@ const add = (a, b) => {

const memorizeAdd = memorize(add)
time("process_1");
memorizeAdd(100,100);
memorizeAdd(100,200);
timeEnd("process_1");
time("process_2");
memorizeAdd(100,200);
memorizeAdd(100,100);
timeEnd("process_2");
time("process_3");
memorizeAdd(100,100);
timeEnd("process_3");
time("process_4");
memorizeAdd(100,200);
timeEnd("process_4");

/*
Function called for Operation 300
Printing Cache Map(1) { '100,200' => 300 }
process_1: 5.239ms
Function called for Operation 200
Printing Cache Map(2) { '100,200' => 300, '100,100' => 200 }
process_2: 0.304ms
process_3: 0.015ms
process_4: 0.008ms
*/

0 comments on commit d344171

Please sign in to comment.