Type/to search
Built-in Functions
Global
Log
Market
Trade
Account
Futures
Exchange
IO
Network
Storage
Threads
exchange.Go
EventLoop
ctx.subscribe
ctx.poll
ctx.book
threading
Thread
Thread.peekMessage
Thread.postMessage
Thread.join
Thread.terminate
Thread.getData
Thread.setData
Thread.id
Thread.name
Thread.eventLoop
ThreadLock
ThreadEvent
ThreadCondition
ThreadDict
Server
TA
Talib
OS
Structures
Built-in Variables and Constants
Conventions
Exchanges

Returns the threadId of the current multi-threaded object instance.

id()

Examples

Create a concurrently running thread and output the threadId of that concurrent thread in the main thread.

javascript
function main() { var t1 = threading.Thread(function() { threading.currentThread().setData("data", 100) }) Log(`t1.id():`, t1.id()) t1.join() }

Returns

TypeDescription

number

Thread ID (threadId).

See Also