Skip to content

Commit cd8c9ba

Browse files
Added Time Readme and updated timer class
1 parent ee06af9 commit cd8c9ba

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

time/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# HTTP
2+
3+
Contains the functionality for basic HTTP requests.
4+
- `datetime` class:
5+
- Methods:
6+
- `now` returns the current date and time as a string along with optional parameter to format it `datetime now : ? @str:format`
7+
- `utcnow` returns the utc date and time as a string along with optional parameter to format it `datetime utcnow : ? @str:format`
8+
- `today` returns today's date and time as a string along with optional parameter to format it `datetime today : ? @str:format`
9+
- `compare` returns `1`, `0`, or `-1` depending on the dates relation to the other date `datetime compare : @str:time1, @str:time2`
10+
- `unixepoch` returns the unix epoch date and time as a string along with optional parameter to format it `datetime unixepoch : ? @str:format`
11+
- `max-value` returns the max value date and time as a string along with optional parameter to format it `datetime max-value : ? @str:format`
12+
- `min-value` returns the min value date and time as a string along with optional parameter to format it `datetime min-value : ? @str:format`
13+
- `days-in-month` returns the days in the month as an int `datetime days-int-month : @str:_time`
14+
- `is-leep-year` returns if the year is a leep year `datetime is-leep-year : @str:_time`
15+
- `day-of-year` returns the day of the year as int `datetime day-of-year : @str:_time`
16+
- `day-of-week` returns the day of the week as str `datetime day-of-week : @str:_time`
17+
- `is-daylight-savings-time` returns if the year is in daylight savings time `datetime is-daylight-savings-time : @str:_time`
18+
- `stopwatch` class:
19+
- Methods:
20+
- `start` starts a stopwatch instance that counts up
21+
- `end` ends the stopwatch in the instance
22+
- `elapsed-nanoseconds` returns the elapsed nanoseconds from the stopwatch instance
23+
- `elapsed-miliseconds` returns the elapsed miliseconds from the stopwatch instance
24+
- `elapsed-seconds` returns the elapsed seconds from the stopwatch instance
25+
- `elapsed-minutes` returns the elapsed minutes from the stopwatch instance
26+
- `elapsed-hours` returns the elapsed hours from the stopwatch instance
27+
- `timer` class:
28+
- Methods:
29+
- `new-instance` returns a new instance of the timer class based off of the variable values `new-instance : @int:hours, @int:minutes, @int:seconds, @int:miliseconds`
30+
- `start` starts a timer with the values from the instance properties
31+
- `stop` stops the timer instance
32+
- `resume` resumes the timer instance
33+
- `is-done` returns if the timer instance has elapsed
34+
- `is-not-done` returns if the timer instance has not elapsed
35+
- Properties:
36+
- `hours` the timer instance's hours
37+
- `minutes` the timer instance's minutes
38+
- `seconds` the timer instance's seconds
39+
- `miliseconds` the timer instance's miliseconds
40+

time/timer.ezcode

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ class timer {
1616
method stop {
1717
runexec EZCodeLanguage.EZHelp.TimerStop ~> {Value}
1818
}
19+
method resume {
20+
runexec EZCodeLanguage.EZHelp.TimerStart ~> {Value}
21+
}
1922
method is-done => @bool {
2023
return runexec EZCodeLanguage.EZHelp.TimerIsDone ~> {Value}
2124
}

0 commit comments

Comments
 (0)