Updating the "BaseDemo.java" class to track execution time and amount of memory used.