Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Difference between Thread and Timer  RSS feed

 
Raja ji
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi to all,

Can anybody tell me what is the differece between Timer and Thread.
When to use Timer and when to use Thread.
 
madan singh
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

You can start the timer on some specific time but not in case of thread.
Thread can implements Singleton(to make low heapSize).
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A Timer is essentially a thread scheduled for execution at one ore more specific times. If you look at the API for TimerTask (which is what gets scheduled), you'll see that it is just about the same as Thread.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!