-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a366e41
commit 7d97f40
Showing
3 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import time | ||
|
||
|
||
# Start timer | ||
startTimer = time.perf_counter() | ||
startTimer2 = time.process_time() | ||
|
||
# List to cycle through | ||
theList = ["a", "b", "i", "c", "d", "e", "n", "h", "j", ".", "m", "n", "l", "o", "t", "."] | ||
|
||
# Start "for" loop to separate values in the list, theList | ||
separation = "." | ||
tempList = [] | ||
finalList = [] | ||
for i in theList: | ||
if i == ".": | ||
tempList.append(i) | ||
finalList.append(tempList) | ||
tempList = [] | ||
else: | ||
tempList.append(i) | ||
|
||
# Append tempList to finalList | ||
finalList.append(tempList) | ||
|
||
endTimer = time.perf_counter() | ||
endTimer2 = time.process_time() | ||
|
||
print(f"Task Finished In Performance: {endTimer - startTimer:0.8f}\nTask Finished In Process/CPU/Kernel + User Space: {endTimer2 - startTimer2:0.8f}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import time | ||
|
||
|
||
# Start timer | ||
startTimer = time.perf_counter() | ||
startTimer2 = time.process_time() | ||
|
||
# List to cycle through | ||
theList = ["a", "b", "i", "c", "d", "e", "n", "h", "j", ".", "m", "n", "l", "o", "t", "."] | ||
|
||
# Start "for" loop | ||
for i in theList: | ||
if i != ".": | ||
continue | ||
else: | ||
print(i) | ||
break | ||
|
||
endTimer = time.perf_counter() | ||
endTimer2 = time.process_time() | ||
|
||
print(f"Task Finished In Performance: {endTimer - startTimer:0.8f}\nTask Finished In Process/CPU/Kernel + User Space: {endTimer2 - startTimer2:0.8f}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import time | ||
|
||
|
||
# Start timer | ||
startTimer = time.perf_counter() | ||
startTimer2 = time.process_time() | ||
|
||
# Random numbers in a list | ||
theList = [4, 5, 1, 3, 6, 10, 8, 9, 11, 7, 20, 22, 13, 17, 18, 12, 16, 71] | ||
|
||
# Run sort | ||
print(theList.sort()) | ||
|
||
endTimer = time.perf_counter() | ||
endTimer2 = time.process_time() | ||
|
||
print(f"Task Finished In Performance: {endTimer - startTimer:0.8f}\nTask Finished In Process/CPU/Kernel + User Space: {endTimer2 - startTimer2:0.8f}") |