Skip to content

millis() is set to 0 in setup(), rather than at start #569

Description

@processing-bugs

Original author: niho...@gmail.com (February 01, 2011 16:32:06)

run the following code:

int m = millis();
int n;
void setup() { size(200,200); noLoop(); n=millis();}
void draw() { println("pre-setup: "+m+", in setup: "+n); }

This will generate an output like:

"pre-setup: -502391864, in setup: 14"

It appears that Processing does not start counting milliseconds-from-start until it hits setup(), rather than at startup time. Additionally, the value returned prior to setup cannot be used as a millis-before-setup, as it is substantially larger than the number of milliseconds that passed between the applet starting and setup() being called

Original issue: http://code.google.com/p/processing/issues/detail?id=530

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions