Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Vladimir Barsukov
zGo
Commits
17495ccc
Commit
17495ccc
authored
Aug 05, 2025
by
Vladimir Barsukov
Browse files
zuptime
parent
d023bbb5
Changes
1
Hide whitespace changes
Inline
Side-by-side
zuptime/zuptime.go
0 → 100644
View file @
17495ccc
package
zuptime
import
"time"
type
ZUptime
struct
{
sTime
time
.
Time
justStart
time
.
Duration
}
func
Default
()
*
ZUptime
{
return
New
(
time
.
Minute
)
}
func
New
(
js
time
.
Duration
)
*
ZUptime
{
return
&
ZUptime
{
sTime
:
time
.
Now
(),
justStart
:
js
}
}
func
(
z
ZUptime
)
JustStart
()
bool
{
return
time
.
Since
(
z
.
sTime
)
<
z
.
justStart
}
func
(
z
ZUptime
)
Seconds
()
int64
{
return
int64
(
time
.
Since
(
z
.
sTime
)
.
Seconds
())
}
func
(
z
ZUptime
)
Minutes
()
int64
{
return
int64
(
time
.
Since
(
z
.
sTime
)
.
Minutes
())
}
func
(
z
ZUptime
)
Hours
()
int64
{
return
int64
(
time
.
Since
(
z
.
sTime
)
.
Hours
())
}
func
(
z
ZUptime
)
Since
()
time
.
Duration
{
return
time
.
Since
(
z
.
sTime
)
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment