added method for measuring execution time and measuring usaged memory