diff --git a/DIRECTORY.md b/DIRECTORY.md
index 7120c868ea..11c6e4f418 100644
--- a/DIRECTORY.md
+++ b/DIRECTORY.md
@@ -113,6 +113,9 @@
* [ReverseString](https://github.com/TheAlgorithms/Javascript/blob/master/String/ReverseString.js)
* [ReverseWords](https://github.com/TheAlgorithms/Javascript/blob/master/String/ReverseWords.js)
+## Timing Functions
+ * [IntervalTimer](https://github.com/TheAlgorithms/Javascript/blob/master/TimingFunctions/IntervalTimer.js)
+
## Trees
* [DepthFirstSearch](https://github.com/TheAlgorithms/Javascript/blob/master/Trees/DepthFirstSearch.js)
diff --git a/TimingFunctions/IntervalTimer.js b/TimingFunctions/IntervalTimer.js
new file mode 100644
index 0000000000..2864a32c27
--- /dev/null
+++ b/TimingFunctions/IntervalTimer.js
@@ -0,0 +1,93 @@
+/**
+ * @author Nandan V
+ * Sunday, 26 July 2020 8:33 AM
+ * @description Singleton class that handles the timing of tests and
+ * specs.
The class is singleton as javascript does not support
+ * multiple timer instances.
+ */
+class IntervalTimer {
+ /**
+ * @description Constructor for Timer.
+ * @param interval Sets the interval for running the timer.
+ * @param callBack The callback function to be executed.
+ * @return {IntervalTimer} If exists, the existing object.
+ */
+ constructor (interval = 10,
+ callBack = () => {}) {
+ this.prevInterval = 0
+ if (this.instance == null) {
+ this.interval = interval
+ this.callBack = callBack
+ this.instance = this
+ } else {
+ return this.instance
+ }
+ }
+
+ /**
+ * @description Starts the timer.
+ */
+ startTimer () {
+ this.timer = setInterval(this.callBack, this.interval)
+ }
+
+ /**
+ * @description Resets the timer.
+ * @return {number} Elapsed time in milliseconds.
+ */
+ resetTimer () {
+ clearInterval(this.timer)
+ this.callBack = () => {}
+ return this.getElapsedTime()
+ }
+
+ /**
+ * @return {number} Elapsed time in milliseconds since reset.
+ */
+ getElapsedTime (offset = 0) {
+ this.timeElapsed = this.timer - this.prevInterval
+ this.prevInterval = this.timer
+ return this.timeElapsed - offset
+ }
+
+ /**
+ * @return {number} Elapsed time since start.
+ */
+ getRunTime () {
+ return this.timer
+ }
+}
+
+/**
+ * @author Nandan V
+ * Saturday, 01 August 2020 8:33 AM
+ * @description Example usage
+ */
+const ExampleIntervalTimer = function () {
+ /**
+ * Create am object with default settings.
+ * @type {IntervalTimer} Used to get timing information.
+ */
+ const timer = new IntervalTimer()
+ timer.startTimer()
+
+ // ... Initialization code ...
+ // I generally use it for timing tests in Jasmine JS.
+
+ /**
+ * Gets the runtime till this point.
+ * Can be subtracted from ElapsedTime to offset timing of initialization code.
+ */
+ const initOffset = timer.getRunTime()
+
+ // ... A test ...
+ // The time taken to run the test.
+ console.log(timer.getElapsedTime(initOffset))
+
+ /**
+ * Returns the elapsed time and resets the timer to 0.
+ */
+ console.log(timer.resetTimer())
+}
+
+ExampleIntervalTimer()