Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Instantiate and start timer on single line #52

Copy link
Copy link
@Evidlo

Description

@Evidlo
Issue body actions

It would be helpful if there was a way to start the timer when it is instantiated, such as t = Timer().start() or t = Timer(now=True).

This can reduce the number of required lines from 3 to 2 which is nice when inserting many timers.

t = Timer().start()
# code block 1
t.stop()

t = Timer().start()
# code block 2
t.stop()

t = Timer().start()
# code block 3
t.stop()

To do this, either .start() would need to return self or a Timer.__post_init__ function would need to if self.now == True.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.